theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
Loading...
Searching...
No Matches
MkBufferListC_TOR_C_API

MkBufferListC - various functions to create and destroy a MkBufferListSMore...

+ Collaboration diagram for MkBufferListC_TOR_C_API:

Macros

#define MkBufferListCreateTLS_T(name, num)
 create a MkBufferListC instance as thread-local-torage
 
#define MkBufferListCreateSTATIC_T(name, num)
 create a MkBufferListC instance on static-storage
 
#define MkBufferListCreateLOCAL_T(name, num)
 create a MkBufferListC instance on local-memory and return an pointer as instance …
 
#define MkBufferListCreateTLS_inout_T(name, num, inout)
 create a MkBufferListC instance as thread-local-torage OR reuse inout if possible…
 

Functions

MK_BFL MkBufferListCreate_RT (MK_RT mkrt, MK_NUM const size)
 Constructs a MkBufferC instance with size storage…
 
MK_BFL MkBufferListCreateTLS_RT (MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
 same as BufferListCreate but require no cleanup …
 
void MkBufferListCreateTLS_T (MK_MACRO_TYP name, MK_NUM const num)
 
void MkBufferListCreateSTATIC_T (MK_MACRO_TYP name, MK_NUM const num)
 
void MkBufferListCreateLOCAL_T (MK_MACRO_TYP name, MK_NUM const num)
 
void MkBufferListCreateTLS_inout_T (MK_MACRO_TYP name, MK_NUM const num, MK_BFL *inout)
 
MK_BFL MkBufferListCreateVC_RT (MK_RT mkrt, MK_NUM const argc, MK_STRN const *argv)
 Constructs a MkBufferListC instance with a argc/argv data from a list of strings …
 
MK_BFL MkBufferListCreateVAL_RT (MK_RT mkrt, MK_STRN const arg0, va_list var_list)
 Constructs a MkBufferListC instance with a va_list argument …
 
MK_BFL MkBufferListCreateVA_RT (MK_RT mkrt, MK_STRN const arg0,...)
 Constructs a MkBufferListC instance with a varargs argument that ends with MK_NULL
 
MK_BFL MkBufferListCreateLA_RT (MK_RT mkrt, MK_BAC const args)
 Constructs a MkBufferListC instance with an other MkBufferListC OR a list of arguments (only in NON C)
 
MK_BFL MkBufferListDup_RT (MK_RT mkrt, MK_BFLN const bfl)
 Dup-Constructor - create a new MkBufferListC instance as copy from an existing MkBufferListC instance …
 
MK_BFL MkBufferListMerge_RT (MK_RT mkrt, MK_BFL const bfl)
 Merge-Constructor - constructs a MkBufferListC instance as a merge from an existing MkBufferListC instance …
 
void MkBufferListInit_RT (MK_RT mkrt, MK_BFL const bfl, MK_NUM const num)
 initialize an already allocated MkBufferListC
 
void MkBufferListFree_RT (MK_RT mkrt, MK_BFL const bfl)
 free the internal data but keep the outher shell alive
 
void MkBufferListDelete_RT (MK_RT mkrt, MK_BFL bfl)
 Destructor - delete a MkBufferListC instance …
 

MkBufferListC - MkBufferListC_TOR_C_API - overload

#define MkBufferListMerge_NULL(...)
 
#define MkBufferListMerge(...)
 
#define MkBufferListDup_NULL(...)
 
#define MkBufferListDup(...)
 
#define MkBufferListCreate_NULL(...)
 
#define MkBufferListCreate(...)
 
#define MkBufferListCreate_0()
 
#define MkBufferListCreateLA_NULL(...)
 
#define MkBufferListCreateLA(...)
 
#define MkBufferListCreateVA_NULL(...)
 
#define MkBufferListCreateVA(...)
 
#define MkBufferListCreateVAL_NULL(...)
 
#define MkBufferListCreateVAL(...)
 
#define MkBufferListCreateVC_NULL(...)
 
#define MkBufferListCreateVC(...)
 
#define MkBufferListDelete(x)
 
#define MkBufferListCreateTLS_NULL(...)
 
#define MkBufferListCreateTLS(...)
 
#define MkBufferListCreateTLS_1(tlsName)
 
#define MkBufferListFree_NULL(...)
 
#define MkBufferListFree(...)
 
#define MkBufferListInit_NULL(...)
 
#define MkBufferListInit(...)
 

Detailed Description

MkBufferListC - various functions to create and destroy a MkBufferListS

Macro Definition Documentation

◆ MkBufferListCreate

#define MkBufferListCreate ( ...)
Value:
MK_BFL MkBufferListCreate_RT(MK_RT mkrt, MK_NUM const size)
Constructs a MkBufferC instance with size storage…
#define MK_RT_CALL

Definition at line 625 of file kernel_overload_mk.h.

◆ MkBufferListCreate_0

#define MkBufferListCreate_0 ( )
Value:
#define MkBufferListCreate(...)

Definition at line 626 of file kernel_overload_mk.h.

◆ MkBufferListCreate_NULL

#define MkBufferListCreate_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 624 of file kernel_overload_mk.h.

◆ MkBufferListCreateLA

#define MkBufferListCreateLA ( ...)
Value:
MK_BFL MkBufferListCreateLA_RT(MK_RT mkrt, MK_BAC const args)
Constructs a MkBufferListC instance with an other MkBufferListC OR a list of arguments (only in NON C...

Definition at line 628 of file kernel_overload_mk.h.

◆ MkBufferListCreateLA_NULL

#define MkBufferListCreateLA_NULL ( ...)
Value:

Definition at line 627 of file kernel_overload_mk.h.

◆ MkBufferListCreateLOCAL_T

#define MkBufferListCreateLOCAL_T ( name,
num )
Value:
struct MkBufferListS name##R = {0}; \
struct MkBufferListS * const name = &name##R; \
MkBufferListInit_RT(MK_RT_CALL name, num)
The CLASS used to store a list of MkBufferS items into a flat array…

create a MkBufferListC instance on local-memory and return an pointer as instance …

Attention
The local-storage must be freed with MkBufferListFree.
Parameters
nameis the instance-pointer and nameR is the instance-reference.
numis the minimal-size of the initial buffer-list, size will be inflated if necessary.
431#define MkBufferListCreateLOCAL_T(name,num) \
432 struct MkBufferListS name##R = {0}; \
433 struct MkBufferListS * const name = &name##R; \
434 MkBufferListInit_RT(MK_RT_CALL name, num)

Definition at line 431 of file MkBufferListC_def_mk.h.

431#define MkBufferListCreateLOCAL_T(name,num) \
432 struct MkBufferListS name##R = {0}; \
433 struct MkBufferListS * const name = &name##R; \
434 MkBufferListInit_RT(MK_RT_CALL name, num)

◆ MkBufferListCreateSTATIC_T

#define MkBufferListCreateSTATIC_T ( name,
num )
Value:
static struct MkBufferListS name##R = {0}; \
struct MkBufferListS * const name = &name##R; \
if (__MkCheckX(MkBufferListC,&name##R)) { \
MkBufferListReset_RT(MK_RT_CALL name); \
} else { \
MkBufferListInit_RT(MK_RT_CALL name,num); \
}
#define __MkCheckX(cls, x)

create a MkBufferListC instance on static-storage

Attention
The static-storage must not be freed.
If the storage exceed the predefined-storage (MkBufferListS_bls_size) the memory will switch to heap-memory.
The next call to the same function will reuse the heap-memory. If required the memory can be freed with MkBufferListFree.
Parameters
nameis the instance-pointer and nameR is the instance-reference.
numis the minimal-size of the initial buffer-list, size will be inflated if necessary.
410#define MkBufferListCreateSTATIC_T(name,num) \
411 static struct MkBufferListS name##R = {0}; \
412 struct MkBufferListS * const name = &name##R; \
413 if (__MkCheckX(MkBufferListC,&name##R)) { \
414 MkBufferListReset_RT(MK_RT_CALL name); \
415 } else { \
416 MkBufferListInit_RT(MK_RT_CALL name,num); \
417 }

Definition at line 410 of file MkBufferListC_def_mk.h.

410#define MkBufferListCreateSTATIC_T(name,num) \
411 static struct MkBufferListS name##R = {0}; \
412 struct MkBufferListS * const name = &name##R; \
413 if (__MkCheckX(MkBufferListC,&name##R)) { \
414 MkBufferListReset_RT(MK_RT_CALL name); \
415 } else { \
416 MkBufferListInit_RT(MK_RT_CALL name,num); \
417 }

◆ MkBufferListCreateTLS

#define MkBufferListCreateTLS ( ...)
Value:
MK_BFL MkBufferListCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferListCreate but require no cleanup …

Definition at line 641 of file kernel_overload_mk.h.

◆ MkBufferListCreateTLS_1

#define MkBufferListCreateTLS_1 ( tlsName)
Value:
MkBufferListCreateTLS(tlsName,true)
#define MkBufferListCreateTLS(...)

Definition at line 642 of file kernel_overload_mk.h.

◆ MkBufferListCreateTLS_inout_T

#define MkBufferListCreateTLS_inout_T ( name,
num,
inout )
Value:
static MkThreadLocal struct MkBufferListS __hidden_##name##R = {0}; \
MK_BFL name = *inout != NULL ? *inout : &__hidden_##name##R; \
if (likely(__MkCheckX(MkBufferListC,name))) { \
MkBufferListReserve_RT(MK_RT_CALL name,num); \
} else { \
MkBufferListInit_RT(MK_RT_CALL name,num); \
MkRefIncr_1X(name); \
}
#define likely(x)
#define MkThreadLocal

create a MkBufferListC instance as thread-local-torage OR reuse inout if possible…

The inout is an external-storage or MK_NULL - the external storage will be reused or if MK_NULL the internal thread-local-storage is used.

Attention
The thread-local-storage must not be freed.
If the storage exceed the predefined-storage (MkBufferListS_bls_size) the memory will switch to heap-memory.
The next call to the same function will reuse the heap-memory. If required the memory can be freed with MkBufferListFree.
Parameters
nameis the instance-pointer and nameR is the instance-reference.
numis the minimal-size of the initial buffer-list, size will be inflated if necessary.
inoutis the preferred-storage, if MK_NULL the thread-local-storage is used.
456#define MkBufferListCreateTLS_inout_T(name,num,inout) \
457 static MkThreadLocal struct MkBufferListS __hidden_##name##R = {0}; \
458 MK_BFL name = *inout != NULL ? *inout : &__hidden_##name##R; \
459 if (likely(__MkCheckX(MkBufferListC,name))) { \
460 MkBufferListReserve_RT(MK_RT_CALL name,num); \
461 } else { \
462 MkBufferListInit_RT(MK_RT_CALL name,num); \
463 MkRefIncr_1X(name); \
464 }

Definition at line 456 of file MkBufferListC_def_mk.h.

456#define MkBufferListCreateTLS_inout_T(name,num,inout) \
457 static MkThreadLocal struct MkBufferListS __hidden_##name##R = {0}; \
458 MK_BFL name = *inout != NULL ? *inout : &__hidden_##name##R; \
459 if (likely(__MkCheckX(MkBufferListC,name))) { \
460 MkBufferListReserve_RT(MK_RT_CALL name,num); \
461 } else { \
462 MkBufferListInit_RT(MK_RT_CALL name,num); \
463 MkRefIncr_1X(name); \
464 }

◆ MkBufferListCreateTLS_NULL

#define MkBufferListCreateTLS_NULL ( ...)
Value:

Definition at line 640 of file kernel_overload_mk.h.

◆ MkBufferListCreateTLS_T

#define MkBufferListCreateTLS_T ( name,
num )
Value:
static MkThreadLocal struct MkBufferListS name##R = {0}; \
MK_BFL name = &name##R; \
if (likely(__MkCheckX(MkBufferListC,&name##R))) { \
MkBufferListReserve_RT(MK_RT_CALL name,num); \
} else { \
MkBufferListInit_RT(MK_RT_CALL name,num); \
MkRefIncr_1X(name); \
}

create a MkBufferListC instance as thread-local-torage

Attention
The thread-local-storage must not be freed.
If the storage exceed the predefined-storage (MkBufferListS_bls_size) the memory will switch to heap-memory.
The next call to the same function will reuse the heap-memory. If required the memory can be freed with MkBufferListFree.
Parameters
nameis the instance-pointer and nameR is the instance-reference.
numis the minimal-size of the initial buffer-list, size will be inflated if necessary.
Attention
on update -> update tmpl/high_lng.h as well !!
384#define MkBufferListCreateTLS_T(name,num) \
385 static MkThreadLocal struct MkBufferListS name##R = {0}; \
386 MK_BFL name = &name##R; \
387 if (likely(__MkCheckX(MkBufferListC,&name##R))) { \
388 MkBufferListReserve_RT(MK_RT_CALL name,num); \
389 } else { \
390 MkBufferListInit_RT(MK_RT_CALL name,num); \
391 MkRefIncr_1X(name); \
392 }

Definition at line 384 of file MkBufferListC_def_mk.h.

384#define MkBufferListCreateTLS_T(name,num) \
385 static MkThreadLocal struct MkBufferListS name##R = {0}; \
386 MK_BFL name = &name##R; \
387 if (likely(__MkCheckX(MkBufferListC,&name##R))) { \
388 MkBufferListReserve_RT(MK_RT_CALL name,num); \
389 } else { \
390 MkBufferListInit_RT(MK_RT_CALL name,num); \
391 MkRefIncr_1X(name); \
392 }

◆ MkBufferListCreateVA

#define MkBufferListCreateVA ( ...)
Value:
MK_BFL MkBufferListCreateVA_RT(MK_RT mkrt, MK_STRN const arg0,...)
Constructs a MkBufferListC instance with a varargs argument that ends with MK_NULL …

Definition at line 630 of file kernel_overload_mk.h.

◆ MkBufferListCreateVA_NULL

#define MkBufferListCreateVA_NULL ( ...)
Value:

Definition at line 629 of file kernel_overload_mk.h.

◆ MkBufferListCreateVAL

#define MkBufferListCreateVAL ( ...)
Value:
MK_BFL MkBufferListCreateVAL_RT(MK_RT mkrt, MK_STRN const arg0, va_list var_list)
Constructs a MkBufferListC instance with a va_list argument …

Definition at line 632 of file kernel_overload_mk.h.

◆ MkBufferListCreateVAL_NULL

#define MkBufferListCreateVAL_NULL ( ...)
Value:

Definition at line 631 of file kernel_overload_mk.h.

◆ MkBufferListCreateVC

#define MkBufferListCreateVC ( ...)
Value:
MK_BFL MkBufferListCreateVC_RT(MK_RT mkrt, MK_NUM const argc, MK_STRN const *argv)
Constructs a MkBufferListC instance with a argc/argv data from a list of strings …

Definition at line 634 of file kernel_overload_mk.h.

◆ MkBufferListCreateVC_NULL

#define MkBufferListCreateVC_NULL ( ...)
Value:

Definition at line 633 of file kernel_overload_mk.h.

◆ MkBufferListDelete

#define MkBufferListDelete ( x)
Value:
void MkBufferListDelete_RT(MK_RT mkrt, MK_BFL bfl)
Destructor - delete a MkBufferListC instance …
#define MkObjectDeleteToNull(fct, NS, x)

Definition at line 637 of file kernel_overload_mk.h.

◆ MkBufferListDup

#define MkBufferListDup ( ...)
Value:
MK_BFL MkBufferListDup_RT(MK_RT mkrt, MK_BFLN const bfl)
Dup-Constructor - create a new MkBufferListC instance as copy from an existing MkBufferListC instance...

Definition at line 621 of file kernel_overload_mk.h.

◆ MkBufferListDup_NULL

#define MkBufferListDup_NULL ( ...)
Value:

Definition at line 620 of file kernel_overload_mk.h.

◆ MkBufferListFree

#define MkBufferListFree ( ...)
Value:
void MkBufferListFree_RT(MK_RT mkrt, MK_BFL const bfl)
free the internal data but keep the outher shell alive

Definition at line 646 of file kernel_overload_mk.h.

◆ MkBufferListFree_NULL

#define MkBufferListFree_NULL ( ...)
Value:

Definition at line 645 of file kernel_overload_mk.h.

◆ MkBufferListInit

#define MkBufferListInit ( ...)
Value:
void MkBufferListInit_RT(MK_RT mkrt, MK_BFL const bfl, MK_NUM const num)
initialize an already allocated MkBufferListC

Definition at line 648 of file kernel_overload_mk.h.

◆ MkBufferListInit_NULL

#define MkBufferListInit_NULL ( ...)
Value:

Definition at line 647 of file kernel_overload_mk.h.

◆ MkBufferListMerge

#define MkBufferListMerge ( ...)
Value:
MK_BFL MkBufferListMerge_RT(MK_RT mkrt, MK_BFL const bfl)
Merge-Constructor - constructs a MkBufferListC instance as a merge from an existing MkBufferListC ins...

Definition at line 617 of file kernel_overload_mk.h.

◆ MkBufferListMerge_NULL

#define MkBufferListMerge_NULL ( ...)
Value:

Definition at line 616 of file kernel_overload_mk.h.

Function Documentation

◆ MkBufferListCreate_RT()

MK_BFL MkBufferListCreate_RT ( MK_RT mkrt,
MK_NUM const size )
extern

Constructs a MkBufferC instance with size storage…

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferListDelete is always possible, but the instance can no longer be used afterwards.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]sizeThe initial size of the instance-local-storage. The MkBufferListC has dynamic-memory-management, the size value is just a hint to provide enought memory for future tasks. The real size created is the maximum of type-ILS-size and size . (default: 0 = use the type-ILS-size)
Returns
The newly created MkBufferListC instance, the instance is owned by the caller

◆ MkBufferListCreateLA_RT()

MK_BFL MkBufferListCreateLA_RT ( MK_RT mkrt,
MK_BAC const args )
extern

Constructs a MkBufferListC instance with an other MkBufferListC OR a list of arguments (only in NON C)

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferListDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferListC instance, the instance is owned by the caller
See also
BufferListDup

◆ MkBufferListCreateLOCAL_T()

void MkBufferListCreateLOCAL_T ( MK_MACRO_TYP name,
MK_NUM const num )

◆ MkBufferListCreateSTATIC_T()

void MkBufferListCreateSTATIC_T ( MK_MACRO_TYP name,
MK_NUM const num )

◆ MkBufferListCreateTLS_inout_T()

void MkBufferListCreateTLS_inout_T ( MK_MACRO_TYP name,
MK_NUM const num,
MK_BFL * inout )

◆ MkBufferListCreateTLS_RT()

MK_BFL MkBufferListCreateTLS_RT ( MK_RT mkrt,
MK_STRN const tlsName,
bool const resetB )
extern

same as BufferListCreate but require no cleanup …

  • A TLS-instance only exists ONCE per thread and ONCE per tlsName in memory.
  • The memory will be reused and must not be freed.
  • If resetB is false (default) than no reset is done

Example from perfserver.c performance test with TLS storage

static enum MkErrorE
Ot_BFLT ( MQ_SERVICE_CALL_ARGS )
{
MK_BFL bfl = MkBufferListCreateTLS_1( "perfserver-BFLT" );
while (MqReadItemExists(mqctx)) {
MkBufferListAppendBUF(bfl,MqReadBUF_e(mqctx));
}
MqSendSTART_E (mqctx);
for (int i=0; i<bfl->cursize; i++) {
MqSendBUF_E (mqctx, MkBufferListIndexGet_e (bfl,i));
}
error:
return MqSendRETURN (mqctx);
}

Example from LibSq3LiteRpcClient.tcl callback dealing the temporary TLS data

# Intro     : Example from tcl-rpc-client of using a CreateTLS-like function (here for MkBufferListC) 
#             to improve code speed and readability.
#
# Problem   : This function is used to invoke a callback (myCb). The arguments come from the argument 
#             list args *and* from a service call (ReadBFL).
#             The problem is that ReadBFL is called *twice* and the *second* call overwrites the value 
#             of the *first* call because CreateTLS always returns *the same* MkBufferListC, just 
#             replaced with a new set of values.
#
# Solution  : The MkBufferListC instance returned by ReadBFL is copied into another MkBufferListC 
#             instance returned by CreateTLS.
#             The "CreateTLS" instance is only created *once* and reused, *but* now we can create as 
#             many MkBufferListC instances as we want, because "CreateTLS" distinguishes the returned 
#             instances by the string identifier. 
#             WITHOUT "CreateTLS" a copy would have to be created (Dup) which would then be destroyed 
#             *after* the callback is called (Delete)

proc Sq3LiteRpcClientExecV2CB {rpc myCb args} {
  set valL [MkBufferListC CreateTLS "Sq3LiteRpcClientExecV2CB→valL"]
  set colL [MkBufferListC CreateTLS "Sq3LiteRpcClientExecV2CB→colL"]

  $valL Copy [$rpc ReadBFL]
  $colL Copy [$rpc ReadBFL]

  $myCb {*}$args $valL $colL
}
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]tlsNameAn per-thread unique name (string) to identify the reuse-able instance-storage. if tlsName is MK_NULL or "" than a MK_NULL is returned
[in]resetBshould the new object be reset?
Returns
the new MkBufferListC instance, the instance belongs to the TLS-function and does not need to be deleted.
Attention
for usage of the TLS-storage read more at StorageCreateTLS

◆ MkBufferListCreateTLS_T()

void MkBufferListCreateTLS_T ( MK_MACRO_TYP name,
MK_NUM const num )

◆ MkBufferListCreateVA_RT()

MK_BFL MkBufferListCreateVA_RT ( MK_RT mkrt,
MK_STRN const arg0,
... )
extern

Constructs a MkBufferListC instance with a varargs argument that ends with MK_NULL

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferListDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferListC instance, the instance is owned by the caller

◆ MkBufferListCreateVAL_RT()

MK_BFL MkBufferListCreateVAL_RT ( MK_RT mkrt,
MK_STRN const arg0,
va_list var_list )
extern

Constructs a MkBufferListC instance with a va_list argument …

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferListDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferListC instance, the instance is owned by the caller
See also
va_start(3), va_arg(3), va_copy(3), and va_end(3)

◆ MkBufferListCreateVC_RT()

MK_BFL MkBufferListCreateVC_RT ( MK_RT mkrt,
MK_NUM const argc,
MK_STRN const * argv )
extern

Constructs a MkBufferListC instance with a argc/argv data from a list of strings …

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferListDelete is always possible, but the instance can no longer be used afterwards.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
argcthe argc from the initial main function
argvthe arguments from the initial main function
Returns
The newly created MkBufferListC instance, the instance is owned by the caller
Attention
a MkBufferListC instance is always created… even if argc = 0
See also
MqCtxTypeS::argvFix
int main (int argc, char *argv[])
{
MK_BFL largs = MkBufferListCreateVC(argc, argv);
....
}
#define MkBufferListCreateVC(...)

◆ MkBufferListDelete_RT()

void MkBufferListDelete_RT ( MK_RT mkrt,
MK_BFL bfl )
extern

Destructor - delete a MkBufferListC instance …

There are two different ways to delete an instance:

ObjectDisposeto free the internal data but keep the outher shell alive - this is called a SOFT-DELETE
ObjectDelete to delete the outher shell including the internal data - this is called a HARD-DELETE
Attention
  1. The internal memory will be freed and the object-pointer will be set to NULL. If the object-pointer is already NULL nothing will be done.
  2. For a programming language without HARD-Delete support, the "Delete" method is assigned to a SOFT-Delete.
  3. For a programming language without garbage collection, a SOFT-delete without a HARD-delete causes a small memory loss (C++: ~32 bytes).
  4. After a SOFT-delete, the outher shell is still alive, but cannot be used. Any access to this shell generates an HDL-null-exception, but this exception can be caught. This is important for C++ as it prevents a core dump.
  5. On HARD-delete read more at MkSelfDeleteForce
See also
BufferListCreate BufferListDup MqReadBFL

◆ MkBufferListDup_RT()

MK_BFL MkBufferListDup_RT ( MK_RT mkrt,
MK_BFLN const bfl )
extern

Dup-Constructor - create a new MkBufferListC instance as copy from an existing MkBufferListC instance …

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferListDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferListC instance, the instance is owned by the caller
See also
MkObjDup

◆ MkBufferListFree_RT()

void MkBufferListFree_RT ( MK_RT mkrt,
MK_BFL const bfl )
extern

free the internal data but keep the outher shell alive

See also
MkBufferListInit

◆ MkBufferListInit_RT()

void MkBufferListInit_RT ( MK_RT mkrt,
MK_BFL const bfl,
MK_NUM const num )
extern

initialize an already allocated MkBufferListC

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]bflthe MkBufferListS instance to work on
numinitial array size
Attention
the bfl have to be initialised with '\0'.

Example: create a static buffer-list with default size of MkBufferListS_bls_size

struct MkBufferListS bflS = {0};
MK_BFL const blf = &bflS;
#define MkBufferListInit(...)
See also
BufferCreate MkObjectS::obj_protect→isLocal

◆ MkBufferListMerge_RT()

MK_BFL MkBufferListMerge_RT ( MK_RT mkrt,
MK_BFL const bfl )
extern

Merge-Constructor - constructs a MkBufferListC instance as a merge from an existing MkBufferListC instance …

The Merge-Constructor create a new object-shell, and take-over all the internal data from the source-object. After the Merge-Constructor the source-object is empty as if a BufferListReset was called.

One usage of the Merge-Constructor is to get a lightweight-copy of a Thread-Local-Storage object for external usage.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]bflthe MkBufferListS instance to work on
Returns
The new instance or MK_NULL on error or if no Merge-Constructor is available
Attention
The new instance have to be deleted with BufferListDelete
See also
BufferListDup