MCPcopy Create free account
hub / github.com/MariaDB/server / MakeOffset

Method MakeOffset

storage/connect/xindex.cpp:3135–3154  ·  view source on GitHub ↗

/ Allocate the offset block used by intermediate key columns. */ /

Source from the content-addressed store, hash-verified

3133/* Allocate the offset block used by intermediate key columns. */
3134/***********************************************************************/
3135int *KXYCOL::MakeOffset(PGLOBAL g, int n)
3136 {
3137 if (!Kof) {
3138 // Calculate the initial size of the offset
3139 Koff.Size = (n + 1) * sizeof(int);
3140
3141 // Allocate the required memory
3142 if (!PlgDBalloc(g, NULL, Koff)) {
3143 strcpy(g->Message, MSG(KEY_ALLOC_ERR));
3144 return NULL; // Error
3145 } // endif
3146
3147 } else if (n) {
3148 // This is a reallocation call
3149 PlgDBrealloc(g, NULL, Koff, (n + 1) * sizeof(int));
3150 } else
3151 PlgDBfree(Koff);
3152
3153 return (int*)Kof;
3154 } // end of MakeOffset
3155
3156/***********************************************************************/
3157/* Make a front end array of key values that are the first value of */

Callers 2

MakeMethod · 0.80
InitMethod · 0.80

Calls 3

PlgDBallocFunction · 0.85
PlgDBreallocFunction · 0.85
PlgDBfreeFunction · 0.85

Tested by

no test coverage detected