Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • xserver xserver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 921
    • Issues 921
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 119
    • Merge requests 119
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • xserverxserver
  • Merge requests
  • !181

Optimize ResourceClientBits() funtion

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Raul Fernandes requested to merge rgfernandes/xserver:resourceclientbits into master Apr 29, 2019
  • Overview 7
  • Commits 1
  • Pipelines 8
  • Changes 9

The LimitClients variable could be set in three different places: os/osinit.c, os/utils.c and hw/xfree86/common/xf86Config.c. In these places, it checks if the variable is 64, 128, 256, 512, 1024 or 2048. So we can optimize ResourceClientBits() to start looking in 7th bit (value of 64). Another optimization is to avoid calling repeatedly the ResourceClientBits() function as the variable LimitClients is set only once. So call ResourceClientBits() only when setting LimitClients. The macros defined in include/resource.h is replaced by global variables and calculated together LimitClients too avoiding to recalculate every time is used.

Edited Apr 24, 2021 by Povilas Kanapickas
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: resourceclientbits