You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would think what might sometimes be good to have is the mode for preset (fixed) item ID numbers, you will specify how many they are and then you will call the function to allocate that many, instead of calling lay_item for each one.
This could be done to check first if ctx->count is zero; if not, then it is an error, but if it is zero then it will set its capacity and count to the specified number, allocate them, and then initialize each item in a loop, similarly than lay_item already does.
(My own "smallxrm" library, which is an implementation of the X resource manager, has a xrm_init_quarks function with a similar use. You will allocate many items with fixed preset ID numbers from the beginning, which can be compile-time constants, rather than having to pass strings always or allocating them and assigning them to variables. (You can still add additional quarks afterward which do not have fixed numbers.))
The text was updated successfully, but these errors were encountered:
I think a good way might be to change the default way to allocate items to allocate them as an array instead of a single, and make the lay_item function call lay_items or something with a value of 1. Maybe I'll do that in a future version.
I would think what might sometimes be good to have is the mode for preset (fixed) item ID numbers, you will specify how many they are and then you will call the function to allocate that many, instead of calling
lay_item
for each one.This could be done to check first if
ctx->count
is zero; if not, then it is an error, but if it is zero then it will set its capacity and count to the specified number, allocate them, and then initialize each item in a loop, similarly thanlay_item
already does.(My own "smallxrm" library, which is an implementation of the X resource manager, has a
xrm_init_quarks
function with a similar use. You will allocate many items with fixed preset ID numbers from the beginning, which can be compile-time constants, rather than having to pass strings always or allocating them and assigning them to variables. (You can still add additional quarks afterward which do not have fixed numbers.))The text was updated successfully, but these errors were encountered: