Skip to content

Add dynit.h z/OS-compatible dynamic allocation interface #24

@mgrossmann

Description

@mgrossmann

Summary

Provide a z/OS-compatible dynit.h header with dynalloc() / dynfree() / dyninit() API for SVC 99 dynamic allocation.

This is the standard struct-based interface that z/OS programmers expect. Under the hood, the implementation uses crent370's existing SVC 99 infrastructure (TXT99, RB99, NewTXT99(), arrayadd(), __svc99()).

Motivation

  • dynit.h is a well-known z/OS interface — offering it makes crent370 more familiar to mainframe developers
  • crent370 already has all the building blocks (svc99.h, rb99.h, txt99.h, @@svc99.asm, 50+ text unit builders)
  • The existing __dsalc() / __dsfree() are string-based; dynalloc() / dynfree() offer a struct-based alternative

Files

  • include/dynit.h — public header with __dyn_t struct, constants, function declarations
  • src/clib/dynalloc.cdynalloc() implementation (one function per module for autocall)
  • src/clib/dynfree.cdynfree() implementation

Design Decisions

  • dyninit() is a pure memset macro (no BREXX-style byte offset hacks)
  • __blksize is unsigned short (not short) since BLKSIZE can exceed 32767
  • __rbx and __emsgparmlist are void* for now (RBX99 support can be added later)
  • Function names dynalloc/dynfree without __ prefix (z/OS standard, not crent internal)
  • asm("DYNALLOC") / asm("DYNFREE") for correct external symbol names

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions