theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - 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 libmkkernel::MkBufferListCreate_RT (MK_RT const mkrt, MK_NUM const size)
 Constructs a MkBufferC instance with size storage…
 
MK_BFL libmkkernel::MkBufferListCreateTLS_RT (MK_RT const mkrt, MK_STRN const tlsName, bool const resetB)
 same as BufferListCreate but require no cleanup …
 
void libmkkernel::MkBufferListCreateTLS_T (MK_MACRO_TYP name, MK_NUM const num)
 
void libmkkernel::MkBufferListCreateSTATIC_T (MK_MACRO_TYP name, MK_NUM const num)
 
void libmkkernel::MkBufferListCreateLOCAL_T (MK_MACRO_TYP name, MK_NUM const num)
 
void libmkkernel::MkBufferListCreateTLS_inout_T (MK_MACRO_TYP name, MK_NUM const num, MK_BFL *inout)
 
MK_BFL libmkkernel::MkBufferListCreateVC_RT (MK_RT const 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 libmkkernel::MkBufferListCreateVAL_RT (MK_RT const mkrt, MK_STRN const arg0, va_list var_list)
 Constructs a MkBufferListC instance with a va_list argument …
 
MK_BFL libmkkernel::MkBufferListCreateVA_RT (MK_RT const mkrt, MK_STRN const arg0,...)
 Constructs a MkBufferListC instance with a varargs argument that ends with MK_NULL
 
MK_BFL libmkkernel::MkBufferListCreateLA_RT (MK_RT const mkrt, MK_BAC const args)
 Constructs a MkBufferListC instance with an other MkBufferListC OR a list of arguments (only in NON C)
 
MK_BFL libmkkernel::MkBufferListDup_RT (MK_RT const mkrt, MK_BFLN const bfl)
 Dup-Constructor - create a new MkBufferListC instance as copy from an existing MkBufferListC instance …
 
MK_BFL libmkkernel::MkBufferListMerge_RT (MK_RT const mkrt, MK_BFL const bfl)
 Merge-Constructor - constructs a MkBufferListC instance as a merge from an existing MkBufferListC instance …
 
void libmkkernel::MkBufferListInit_RT (MK_RT const mkrt, MK_BFL const bfl, MK_NUM const num)
 initialize an already allocated MkBufferListC
 
void libmkkernel::MkBufferListFree_RT (MK_RT const mkrt, MK_BFL const bfl)
 free the internal data but keep the outher shell alive
 
void libmkkernel::MkBufferListDelete_RT (MK_RT const 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:
MkBufferListCreate_RT(MK_RT_CALL __VA_ARGS__)
#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:
MkBufferListCreate_RT(MK_RT_CALL_NULL __VA_ARGS__)
#define MK_RT_CALL_NULL

Definition at line 624 of file kernel_overload_mk.h.

◆ MkBufferListCreateLA

#define MkBufferListCreateLA ( ...)
Value:
MkBufferListCreateLA_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 628 of file kernel_overload_mk.h.

◆ MkBufferListCreateLA_NULL

#define MkBufferListCreateLA_NULL ( ...)
Value:
MkBufferListCreateLA_RT(MK_RT_CALL_NULL __VA_ARGS__)

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)

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.
425#define MkBufferListCreateLOCAL_T(name,num) \
426 struct MkBufferListS name##R = {0}; \
427 struct MkBufferListS * const name = &name##R; \
428 MkBufferListInit_RT(MK_RT_CALL name, num)

Definition at line 425 of file MkBufferListC_def_mk.h.

425#define MkBufferListCreateLOCAL_T(name,num) \
426 struct MkBufferListS name##R = {0}; \
427 struct MkBufferListS * const name = &name##R; \
428 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.
404#define MkBufferListCreateSTATIC_T(name,num) \
405 static struct MkBufferListS name##R = {0}; \
406 struct MkBufferListS * const name = &name##R; \
407 if (__MkCheckX(MkBufferListC,&name##R)) { \
408 MkBufferListReset_RT(MK_RT_CALL name); \
409 } else { \
410 MkBufferListInit_RT(MK_RT_CALL name,num); \
411 }

Definition at line 404 of file MkBufferListC_def_mk.h.

404#define MkBufferListCreateSTATIC_T(name,num) \
405 static struct MkBufferListS name##R = {0}; \
406 struct MkBufferListS * const name = &name##R; \
407 if (__MkCheckX(MkBufferListC,&name##R)) { \
408 MkBufferListReset_RT(MK_RT_CALL name); \
409 } else { \
410 MkBufferListInit_RT(MK_RT_CALL name,num); \
411 }

◆ MkBufferListCreateTLS

#define MkBufferListCreateTLS ( ...)
Value:
MkBufferListCreateTLS_RT(MK_RT_CALL __VA_ARGS__)

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.
450#define MkBufferListCreateTLS_inout_T(name,num,inout) \
451 static MkThreadLocal struct MkBufferListS __hidden_##name##R = {0}; \
452 MK_BFL name = *inout != NULL ? *inout : &__hidden_##name##R; \
453 if (likely(__MkCheckX(MkBufferListC,name))) { \
454 MkBufferListReserve_RT(MK_RT_CALL name,num); \
455 } else { \
456 MkBufferListInit_RT(MK_RT_CALL name,num); \
457 MkRefIncr_1X(name); \
458 }

Definition at line 450 of file MkBufferListC_def_mk.h.

450#define MkBufferListCreateTLS_inout_T(name,num,inout) \
451 static MkThreadLocal struct MkBufferListS __hidden_##name##R = {0}; \
452 MK_BFL name = *inout != NULL ? *inout : &__hidden_##name##R; \
453 if (likely(__MkCheckX(MkBufferListC,name))) { \
454 MkBufferListReserve_RT(MK_RT_CALL name,num); \
455 } else { \
456 MkBufferListInit_RT(MK_RT_CALL name,num); \
457 MkRefIncr_1X(name); \
458 }

◆ MkBufferListCreateTLS_NULL

#define MkBufferListCreateTLS_NULL ( ...)
Value:
MkBufferListCreateTLS_RT(MK_RT_CALL_NULL __VA_ARGS__)

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 !!
378#define MkBufferListCreateTLS_T(name,num) \
379 static MkThreadLocal struct MkBufferListS name##R = {0}; \
380 MK_BFL name = &name##R; \
381 if (likely(__MkCheckX(MkBufferListC,&name##R))) { \
382 MkBufferListReserve_RT(MK_RT_CALL name,num); \
383 } else { \
384 MkBufferListInit_RT(MK_RT_CALL name,num); \
385 MkRefIncr_1X(name); \
386 }

Definition at line 378 of file MkBufferListC_def_mk.h.

378#define MkBufferListCreateTLS_T(name,num) \
379 static MkThreadLocal struct MkBufferListS name##R = {0}; \
380 MK_BFL name = &name##R; \
381 if (likely(__MkCheckX(MkBufferListC,&name##R))) { \
382 MkBufferListReserve_RT(MK_RT_CALL name,num); \
383 } else { \
384 MkBufferListInit_RT(MK_RT_CALL name,num); \
385 MkRefIncr_1X(name); \
386 }

◆ MkBufferListCreateVA

#define MkBufferListCreateVA ( ...)
Value:
MkBufferListCreateVA_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 630 of file kernel_overload_mk.h.

◆ MkBufferListCreateVA_NULL

#define MkBufferListCreateVA_NULL ( ...)
Value:
MkBufferListCreateVA_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 629 of file kernel_overload_mk.h.

◆ MkBufferListCreateVAL

#define MkBufferListCreateVAL ( ...)
Value:
MkBufferListCreateVAL_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 632 of file kernel_overload_mk.h.

◆ MkBufferListCreateVAL_NULL

#define MkBufferListCreateVAL_NULL ( ...)
Value:
MkBufferListCreateVAL_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 631 of file kernel_overload_mk.h.

◆ MkBufferListCreateVC

#define MkBufferListCreateVC ( ...)
Value:
MkBufferListCreateVC_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 634 of file kernel_overload_mk.h.

◆ MkBufferListCreateVC_NULL

#define MkBufferListCreateVC_NULL ( ...)
Value:
MkBufferListCreateVC_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 633 of file kernel_overload_mk.h.

◆ MkBufferListDelete

#define MkBufferListDelete ( x)
Value:
MkObjectDeleteToNull(MkBufferListDelete_RT,x)
#define MkObjectDeleteToNull(fct, x)

Definition at line 637 of file kernel_overload_mk.h.

◆ MkBufferListDup

#define MkBufferListDup ( ...)
Value:
MkBufferListDup_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 621 of file kernel_overload_mk.h.

◆ MkBufferListDup_NULL

#define MkBufferListDup_NULL ( ...)
Value:
MkBufferListDup_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 620 of file kernel_overload_mk.h.

◆ MkBufferListFree

#define MkBufferListFree ( ...)
Value:
MkBufferListFree_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 646 of file kernel_overload_mk.h.

◆ MkBufferListFree_NULL

#define MkBufferListFree_NULL ( ...)
Value:
MkBufferListFree_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 645 of file kernel_overload_mk.h.

◆ MkBufferListInit

#define MkBufferListInit ( ...)
Value:
MkBufferListInit_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 648 of file kernel_overload_mk.h.

◆ MkBufferListInit_NULL

#define MkBufferListInit_NULL ( ...)
Value:
MkBufferListInit_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 647 of file kernel_overload_mk.h.

◆ MkBufferListMerge

#define MkBufferListMerge ( ...)
Value:
MkBufferListMerge_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 617 of file kernel_overload_mk.h.

◆ MkBufferListMerge_NULL

#define MkBufferListMerge_NULL ( ...)
Value:
MkBufferListMerge_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 616 of file kernel_overload_mk.h.

Function Documentation

◆ MkBufferListCreate_RT()

MK_BFL libmkkernel::MkBufferListCreate_RT ( MK_RT const 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 libmkkernel::MkBufferListCreateLA_RT ( MK_RT const 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 libmkkernel::MkBufferListCreateLOCAL_T ( MK_MACRO_TYP name,
MK_NUM const num )

◆ MkBufferListCreateSTATIC_T()

void libmkkernel::MkBufferListCreateSTATIC_T ( MK_MACRO_TYP name,
MK_NUM const num )

◆ MkBufferListCreateTLS_inout_T()

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

◆ MkBufferListCreateTLS_RT()

MK_BFL libmkkernel::MkBufferListCreateTLS_RT ( MK_RT const 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.cc performance test with TLS storage

void BFLT () {
auto bfl = MkBufferListC::CreateTLS( "perfserver-BFLT" ) ;
while (ReadItemExists()) {
bfl->AppendBUF(ReadBUF());
}
SendSTART();
for (MK_NUM i=0; i<bfl->Size(); ++i) {
SendBUF(bfl->IndexGet(i));
}
SendRETURN();
}

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 libmkkernel::MkBufferListCreateTLS_T ( MK_MACRO_TYP name,
MK_NUM const num )

◆ MkBufferListCreateVA_RT()

MK_BFL libmkkernel::MkBufferListCreateVA_RT ( MK_RT const 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 libmkkernel::MkBufferListCreateVAL_RT ( MK_RT const 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 libmkkernel::MkBufferListCreateVC_RT ( MK_RT const 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(...)
The CLASS used to store a list of MkBufferS items into a flat array…

◆ MkBufferListDelete_RT()

void libmkkernel::MkBufferListDelete_RT ( MK_RT const 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 libmkkernel::MkBufferListDup_RT ( MK_RT const 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 libmkkernel::MkBufferListFree_RT ( MK_RT const mkrt,
MK_BFL const bfl )
extern

free the internal data but keep the outher shell alive

See also
MkBufferListInit

◆ MkBufferListInit_RT()

void libmkkernel::MkBufferListInit_RT ( MK_RT const 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;
struct MkBufferListS * MK_BFL
class-shortcut for struct MkBufferListS *, all shortcut using the XX_YYY syntax (only for public API)...
#define MkBufferListInit(...)
See also
BufferCreate MkObjectS::obj_protect→isLocal

◆ MkBufferListMerge_RT()

MK_BFL libmkkernel::MkBufferListMerge_RT ( MK_RT const 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