Reusing memory portions on embedded devices
Patent Information
- Application Number
- PCT/EP2025/054908
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2026-08-27
Smart Images

Figure EP2025054908_27082026_PF_FP_ABST
Abstract
Description
REUSING MEMORY PORTIONS ON EMBEDDED DEVICESBACKGROUND
[0001] Embedded devices face memory management challenges due to their limited resources and storage constraints. When memory blocks are deleted on these devices, the space typically becomes unusable without complex overhead management systems, requiring large temporary storage and raising privacy concerns, particularly for sensitive data like encryption keys.BRIEF SUMMARY
[0002] In some aspects, the techniques described herein relate to a system including: one or more hardware processors; and at least one machine-storage medium for storing instructions that, when executed by the one or more hardware processors, cause the one or more hardware processors to perform operations including: organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each of the plurality of memory blocks including a header specifying a status of the memory block and a length of user data inside the memory block, the status including one of a free state, a used state, or a deleted state; maintaining a pointer to identify a next free memory block of the memory blocks in the region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; and in response to determining that the pointer has reached an end of the allocated region of the memory: identifying a first set of memory blocks having the status in the deleted state; and storing user data, associated with a second set of memory blocks, in the first set of memory blocks.
[0003] In some aspects, the techniques described herein relate to a system, the operations including: moving user data previously stored in the second set of memory blocks having the status in the used state into the first set of memory blocks.
[0004] In some aspects, the techniques described herein relate to a system, the operations including: overwriting user data previously stored in the first set of memory blocks with at least a portion of the user data stored in the second set of memory blocks; and changing the status of the second set of memory blocks to the free state in responseto moving the user data from the second set of memory blocks to the first set of memory blocks.
[0005] In some aspects, the techniques described herein relate to a system, the operations including: combining adjacent memory blocks having the status in the deleted state to form larger free memory blocks including the first set of memory blocks; and updating the header associated with the adjacent memory blocks to represent a size of the adjacent memory blocks.
[0006] In some aspects, the techniques described herein relate to a system, the operations including: accessing the header of a first memory block that sequentially follows the combined adjacent memory blocks; determining the length of the user data stored in the first memory block; comparing the length of the user data stored in the first memory block to the size of the adjacent memory blocks; and determining whether the size of the adjacent memory blocks is greater than the length of the user data stored in the first memory block.
[0007] In some aspects, the techniques described herein relate to a system, the operations including: in response to determining that the size of the adjacent memory blocks is greater than the length of the user data stored in the first memory block, moving the user data from the first memory block to the adjacent memory blocks.
[0008] In some aspects, the techniques described herein relate to a system, the operations including: determining that the adjacent memory blocks include unused portions after moving the user data from the first memory block to the adjacent memory blocks; and in response to determining that the adjacent memory blocks include the unused portions after moving the user data from the first memory block to the adjacent memory blocks, storing a new header for a sub-block of the adjacent memory blocks representing a size of the unused portions in the sub-block.
[0009] In some aspects, the techniques described herein relate to a system, the operations including: in response to determining that the size of the adjacent memory blocks is less than the length of the user data stored in the first memory block, searching for a second memory block that sequentially follows the first memory block having a corresponding length of the user data stored in the header that is smaller than the size of the adjacent memory blocks.
[0010] In some aspects, the techniques described herein relate to a system, wherein the memory blocks have different sizes.
[0011] In some aspects, the techniques described herein relate to a system, wherein a size of each memory block is static.
[0012] In some aspects, the techniques described herein relate to a system, wherein the operations for identifying the first set of memory blocks having the status in the deleted state include: parsing the headers of the plurality of memory blocks from lower addresses to higher addresses to identify a header in which the status includes the deleted state.
[0013] In some aspects, the techniques described herein relate to a system, the operations including: updating the pointer to reference to a portion of the allocated region that follows the second set of memory blocks, the portion having a starting address and ending at an ending address of the region, and each memory block in the portion being in the free or deleted state.
[0014] In some aspects, the techniques described herein relate to a system, wherein the header includes an integrity protection field calculated based on a mathematical sum of bytes in a size field of the header.
[0015] In some aspects, the techniques described herein relate to a system, wherein the header includes a first portion and a second portion, the first portion including the status, and the second portion including the length of the user data.
[0016] In some aspects, the techniques described herein relate to a system, the operations including: using data stored in the first portion of the header to verify that the length of the user data stored in the second portion is correct.
[0017] In some aspects, the techniques described herein relate to a system, wherein moving the user data includes: identifying a first used memory block located after a free memory block; determining whether the free memory block has sufficient size to store user data from the first used memory block; and in response to determining the free memory block has sufficient size, moving the user data from the first used memory block to the free memory block.
[0018] In some aspects, the techniques described herein relate to a method including: organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each of the plurality of memory blocks including a header specifying status ofthe memory block and a length of user data inside the memory block, the status including one of a free state, a used state, or a deleted state; maintaining a pointer to identify a next free memory block of the memory blocks in the region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; and in response to determining that the pointer has reached an end of the allocated region of the memory: identifying a first set of memory blocks having the status in the deleted state; and moving user data stored in a second set of memory blocks having the status in the used state into the first set of memory blocks.
[0019] In some aspects, the techniques described herein relate to a machine-storage medium for storing instructions that, when executed by one or more hardware processors, cause the one or more hardware processors to perform operations including: organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each of the plurality of memory blocks including a header specifying status of the memory block and a length of user data inside the memory block, the status including one of a free state, a used state, or a deleted state; maintaining a pointer to identify a next free memory block of the memory blocks in the region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; and in response to determining that the pointer has reached an end of the allocated region of the memory: identifying a first set of memory blocks having the status in the deleted state; and moving user data stored in a second set of memory blocks having the status in the used state into the first set of memory blocks.
[0020] In some aspects, the techniques described herein relate to a machine-storage medium, the operations including: moving user data previously stored in the second set of memory blocks having the status in the used state into the first set of memory blocks.
[0021] In some aspects, the techniques described herein relate to a machine-storage medium, the operations including: overwriting user data previously stored in the first set of memory blocks with at least a portion of the user data stored in the second set of memory blocks; and changing the status of the second set of memory blocks to the free state in response to moving the user data from the second set of memory blocks to the first set of memory blocks.BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
[0022] To easily identify the discussion of any particular element or act, the most significant digit or digits in a reference number refer to the figure number in which that element is first introduced.
[0023] FIG. 1 is a diagrammatic representation of a networked environment in which the present disclosure may be deployed, in accordance with some examples.
[0024] FIG. 2 illustrates an allocated memory region, in accordance with some examples.
[0025] FIG. 3 are diagrams of various states of memory blocks in the allocated memory region, in accordance with some examples.
[0026] FIG. 4 are diagrams of various states of memory blocks in the allocated memory region, in accordance with some examples.
[0027] FIG. 5 illustrates a routine for managing deleted memory blocks, in accordance with some examples.
[0028] FIG. 6 illustrates a routine for managing deleted memory blocks, in accordance with some examples.
[0029] FIG. 7 is a block diagram illustrating a representative software architecture, which may be used in conjunction with various hardware architectures herein described, in accordance with some examples.
[0030] FIG. 8 is a diagrammatic representation of a machine in the form of a computer system within which a set of instructions may be executed for causing the machine to perform any one or more of the methodologies discussed herein, in accordance with some examples.DETAILED DESCRIPTION
[0031] Example methods and systems for a filesystem management in embedded devices, such as in access control systems, are described. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the disclosed examples. It will be evident, however, to one of ordinary skill in the art that examples of the disclosure may be practiced without these specific details.
[0032] Conventional memory management approaches on embedded devices suffer from significant inefficiencies in how they handle memory allocation. When memory blocks are no longer needed, these systems typically mark them as unavailable without any mechanism to reclaim that space, effectively wasting valuable memory resources on devices that already operate under strict memory constraints. These systems rely on complex pointer management structures and large allocation tables to track memory blocks. For example, filesystems, such as FAT or NTFS, demand substantial mapping tables to monitor memory blocks, making them impractical for resource-constrained embedded environments. Java-based solutions attempt to address this through garbage collection and reference tables, but the overhead required for maintaining these structures is prohibitively resource-intensive for embedded devices.
[0033] The most common workaround employed by conventional systems is to delete the entire filesystem and reconstruct it when memory needs to be reclaimed. This approach is extremely inefficient and poses significant risks, particularly when handling sensitive data like encryption keys. This is because such approaches need a large temporary storage and raise privacy and security concerns. Furthermore, attempts to contain the problem by reserving specific memory regions for particular applications merely segment the available memory rather than addressing the fundamental inefficiency of memory block management.
[0034] The disclosed system addresses these technical issues by organizing the filesystem in memory blocks with headers that contain status and size information, eliminating the need for complex allocation tables. Each memory block includes a compact header specifying whether the block is free / used and the length of user data, allowing efficient tracking without additional management overhead. The system employs a pointer-based approach that allocates memory sequentially from lower to higher addresses. When the allocated region is full, the disclosed techniques implement a multi-step process to reclaim space. First, the disclosed techniques combine adjacent free / deleted blocks to create larger usable spaces. Second, the disclosed techniques search for appropriately sized free blocks (e.g., combined deleted blocks) to store new data. If needed, the disclosed techniques perform a simplified garbage collection that moves used blocks into free / deleted spaces. In some cases, only used blocks that are adjacent to the free / deleted blocks (e.g., combined deleted blocks) are moved into a space available in the free / deleted blocks (e.g., combined deleted blocks). This approachsignificantly reduces memory waste while maintaining system integrity through headerbased status tracking rather than complex pointer management structures.
[0035] In some examples, the disclosed techniques organize a filesystem in a plurality of memory blocks of an allocated region of memory, each of the plurality of memory blocks comprising a header specifying status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state. The disclosed techniques maintain a pointer to identify a next free memory block of the memory blocks in the region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state. The disclosed techniques, in response to determining that the pointer has reached an end of the allocated region of the memory, identify a first set of memory blocks having the status in the deleted state and store user data, associated with a second set of memory blocks, in the first set of memory blocks.
[0036] When a memory block is deleted, its header is updated to mark it as "free," such as by setting bit 8 to 0 in an OPTION field of the header. The memory block retains its original size information in the header but is now considered available for reuse. These deleted blocks, now marked as free, are identified by parsing through the filesystem memory block headers from lower to higher addresses. When the system needs to reclaim space, it first combines adjacent free blocks (which may have previously been deleted) by updating the SIZE field in the header of the first free block to encompass all contiguous free blocks, creating larger usable spaces. After combining, these consolidated blocks are treated as single larger free blocks that can be used to store new data or accommodate moved blocks during garbage collection. The system makes no distinction between blocks that were originally free and those that became free through deletion, as they are managed identically once marked as free in their headers.
[0037] Any reference to a free, used, and / or deleted memory block in this description indicates that the system has accessed the block's header and determined its status by reading the status information from the OPTION field or by some other suitable means. For example, the system can use dedicated status bits in the header, implementing status flags within the SIZE field, and / or utilizing reserved portions of the header to encode block status information.
[0038] FIG. 1 is a block diagram showing an example access control system 103, according to various examples. The access control system 103 can include a client device 104 having an embedded device 110, a server 106, and PAC device 101. The client device 104 and the PAC (physical access control) device 101 are communicatively coupled over a network 102 (e.g., Internet, BLE, ultra-wideband (UWB) communication protocol, Near Field Communication (NFC), and / or telephony network) with each other and with the server 106. The embedded device 110 can implement memory management techniques for reusing deleted memory blocks without requiring complex allocation tables. While the disclosed techniques are discussed in the context of filesystems implemented as embedded devices of PAC devices, similar techniques are applicable to filesystems implemented on any other type of embedded device, including a logical access control (LAC) device.
[0039] The embedded device 110 can be implemented in various forms, including smart cards and secure elements that utilize efficient memory management for storing sensitive data like encryption keys and credentials. Resource-constrained devices with limited memory capacity can also serve as embedded devices, such as RFID chips in cards and fobs, personal electronic devices like mobile phones, wearable devices (e.g., smart watches), portable digital assistants (PDAs), smart home devices and appliances, and physical access control readers and controllers. The embedded device 110 can also be implemented as embedded systems calling for non-volatile memory management, including microprocessor-based consumer electronics, Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Radio-Frequency Integrated Circuits (RFICs), and other types of Integrated Circuit (IC) chips.
[0040] For access control applications, for example, the embedded device 110 can be implemented in devices that store and manage authorization data, credential information, access control parameters, security configurations, and encryption keys, such as the client device 104. The embedded device 110 can be any device that calls for dynamic memory allocation, efficient reuse of deleted memory blocks, memory management without complex allocation tables, header-based memory block organization, and / or protection of sensitive data during memory operations. The embedded device 110 can be suited for implementations where memory resources are limited and conventional memory management approaches like Java-based garbage collection or complex pointer management structures would be too resource-intensive. The embedded device 110 canbe valuable for devices that operate under strict memory constraints but still need to maintain system integrity and protect sensitive data.
[0041] As used herein, the term “client device” may refer to any machine that interfaces to a communications network (such as network 102) to exchange credentials with an access control device, such as the PAC device 101, the server 106 associated with the access control device, another client device 104, or any other component to obtain access to a logical or physical asset or resource protected by the access control device. In some examples, the client device 104 can additionally or alternatively communicate directly with, for example, an access control device or another client device 104. The client device 104 can include or store one or more credentials which can be provided to the access control device 101 for obtaining access to a protected physical or logical asset or resource.
[0042] A client device 104 may be, but is not limited to, a mobile phone, desktop computer, laptop, portable digital assistant (PDA), smart phone, a wearable device (e.g., a smart watch), tablet, ultrabook, netbook, multi-processor system, microprocessor-based or programmable consumer electronics, physical card, or any other communication device that a user may use to access a network.
[0043] The access control device (e.g., the PAC device 101) can include an access reader device (also referred to as an access control reader) connected to a secure / protected resource (e.g., a door-locking mechanism or backend server) that controls the secure / protected resource (e.g., door-locking mechanism). The resource associated with the access control device can include a door lock, an ignition system for a vehicle, or any other device that grants or denies access to a physical component or that can be operated to grant or deny access to the physical component. For example, in the case of a door lock, the access control device can deny access, in which case the door lock remains locked and the door cannot be opened; or can grant access, in which case the door lock becomes unlocked to allow the door to be opened. As another example, in the case of an ignition system, the access control device can deny access, in which case the vehicle ignition system remains disabled and the vehicle cannot be started; or can grant access, in which case the vehicle ignition becomes enabled to allow the vehicle to be started.
[0044] PAC covers a range of systems and methods to govern access, for example by people, to secure areas or secure assets. PAC includes identification of authorized users or devices (e.g., vehicles, drones, etc.) and actuation of a gate, door, or other facility used to secure an area, or actuation of a control mechanism, for example, a physical or electronic / software control mechanism, permitting access to a secure asset. The access control device may form part of a physical access control system (PACS), which can include a reader (e.g., an online or offline reader) that may hold authorization data (also referred to as access control information) and can be capable of determining whether credentials (e.g., from credential or key devices such as radio frequency identification (RFID) chips in cards, fobs, or personal electronic devices such as mobile phones) are authorized for an actuator or control mechanism (e.g., door lock, door opener, software control mechanism, turning off an alarm, etc.), or a PACS can include a host server 106 to which readers and actuators are connected (e.g., via a controller) in a centrally managed configuration.
[0045] In centrally managed configurations, readers can obtain credentials from credential or key devices (e.g., from one or more client devices 104) and pass those credentials to the PACS host server (e.g., server 106) or headend system. The readers can send the credentials over a wired or wireless link, such as network 102. The host server then determines whether the credentials authorize access to the secure area or secure asset (or resource) and commands the actuator or other control mechanism of the PAC device 101 accordingly by sending an allow / deny message back to the reader over the wired or wireless link.
[0046] In general, the PAC device 101 can include one or more of a memory, a processor, one or more antennas, a communication module, a network interface device, a user interface, a display, and a power source or supply. The memory of the PAC device 101 can be used in connection with the execution of application programming or instructions by the processor of the PAC device 101, and for the temporary or long-term storage of program instructions or instruction sets and / or credential or authorization data, such as credential data, credential authorization data, or access control data or instructions. For example, the memory can contain executable instructions that are used by the processor to run other components of PAC device 101 and / or to make access determinations based on credential or authorization data, such as by communicating with the authorization system 107 of the server 106.
[0047] The memory of the PAC device 101, server 106, and / or client device 104 including the embedded device 110 can include a transitory or non-transitory computer-readable medium. The computer-readable medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device. More specific examples of suitable computer-readable medium include, but are not limited to, an electrical connection having one or more wires or a tangible storage medium such as a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable readonly memory (EPROM or Flash memory), Dynamic RAM (DRAM), any solid-state storage device in general, a compact disc read-only memory (CD-ROM), or other optical or magnetic storage device. Computer-readable media includes, but is not to be confused with, computer-readable storage medium, which is intended to cover all physical, non-transitory, or similar examples of computer-readable media.
[0048] The processor of the PAC device 101 can correspond to one or more computer processing devices or resources. For instance, the processor can be provided as silicon, as a Field Programmable Gate Array (FPGA), an Application-Specific Integrated Circuit (ASIC), any other type of Integrated Circuit (IC) chip, a collection of IC chips, or the like. As a more specific example, the processor can be provided as a microprocessor, Central Processing Unit (CPU), or plurality of microprocessors or CPUs that are configured to execute instructions sets stored in an internal memory and / or memory of the access control device.
[0049] The antenna of the PAC device 101 can correspond to one or multiple antennas and can be configured to provide for wireless communications between PAC device 101 and a credential or key device (e.g., client device 104). The antenna can be arranged to operate using one or more wireless communication protocols and operating frequencies including, but not limited to, the IEEE 802.15.1, Bluetooth, BLE, NFC, ZigBee, Global System for Mobile communications (GSM), Code Division Multiple Access (CDMA), Wi-Fi, RF, UWB, and the like. By way of example, the antenna(s) can be RF antenna(s), and as such, may transmit / receive RF signals through free space to be received / transferred by a credential or key device having an RF transceiver.
[0050] A communication module or communication component of the PAC device 101 can be configured to communicate according to any suitable communications protocol with one or more different systems or devices either remote or local to the PAC device101, such as one or more client devices 104 and / or servers / controllers, such as server 106. In some cases, the communication module uses a same wired or wireless link between the PAC device 101 and the server 106 for all the communication modes. In some cases, the communication module uses one wired or wireless link between the PAC device 101 and the server 106 to communicate access control information to the authorization system 107 and uses a different wired or wireless link to communicate or receive configuration information updates from the server 106 over the Internet Protocol (IP) communication mode.
[0051] The network interface device of the PAC device 101 includes hardware to facilitate communications with other devices, such as a one or more client devices 104 and / or server / controller (e.g., server 106), over a communication network, such as network 102, utilizing any one of a number of transfer protocols (e.g., frame relay, IP, transmission control protocol (TCP), user datagram protocol (UDP), hypertext transfer protocol (HTTP), etc.). Example communication networks can include a local area network (LAN), a wide area network (WAN), a packet data network (e.g., the Internet), mobile telephone networks (e.g., cellular networks), Plain Old Telephone (POTS) networks, wireless data networks (e.g., IEEE 802.11 family of standards known as WiFi, IEEE 802.16 family of standards known as WiMax), IEEE 802.15.4 family of standards, and peer-to-peer (P2P) networks, among others. In some examples, the network interface device can include an Ethernet port or other physical jack, a Wi-Fi card, a Network Interface Card (NIC), a cellular interface (e.g., antenna, filters, and associated circuitry), or the like. In some examples, the network interface device can include a plurality of antennas to wirelessly communicate using at least one of singleinput multiple-output (SIMO), multiple-input multiple-output (MIMO), or multiple-input single-output (MISO) techniques.
[0052] A user interface of the PAC device 101 can include one or more input devices and / or display devices. Examples of suitable user input devices that can be included in the user interface include, without limitation, one or more buttons, a keyboard or keypad, a mouse, a touch-sensitive surface, a stylus, a camera, a microphone, and so forth.Examples of suitable user output devices that can be included in the user interface include, without limitation, one or more light emitting diodes (LEDs), a liquid crystal display (LCD) panel, a display screen, a touchscreen, one or more lights, a speaker, andso forth. It should be appreciated that the user interface can also include a combined user input and user output device, such as a touch-sensitive display or the like.
[0053] The network 102 may include, or operate in conjunction with, an ad hoc network, an intranet, an extranet, a virtual private network (VPN), a LAN, a wireless network, a wireless LAN (WLAN), a WAN, a wireless WAN (WWAN), a metropolitan area network (MAN), BLE, UWB, the Internet, a portion of the Internet, a portion of the Public Switched Telephone Network (PSTN), a POTS network, a cellular telephone network, a wireless network, a Wi-Fi® network, another type of network, or a combination of two or more such networks. For example, a network or a portion of a network may include a wireless or cellular network and the coupling may be a CDMA connection, a GSM connection, or other type of cellular or wireless coupling. In this example, the coupling may implement any of a variety of types of data transfer technology, such as Single Carrier Radio Transmission Technology (IxRTT), Evolution-Data Optimized (EVDO) technology, General Packet Radio Service (GPRS) technology, Enhanced Data rates for GSM Evolution (EDGE) technology, third Generation Partnership Project (3 GPP) including 3G, fourth generation wireless (4G) networks, fifth generation wireless (5G) networks, Universal Mobile Telecommunications System (UMTS), High Speed Packet Access (HSPA), Worldwide Interoperability for Microwave Access (WiMAX), Long Term Evolution (LTE) standard, others defined by various standard setting organizations, other short range or long range protocols, or other data transfer technology.
[0054] In an example, as the client device 104 approaches the PAC device 101 (e.g., comes within range of a BLE communication protocol), the client device 104 transmits credentials (e.g., stored by the embedded device 110) of the client device 104 over the network 102. In one example, the client device 104 provides the credentials directly to the PAC device 101. In such cases, the PAC device 101 communicates the credentials with the server 106. The server 106 includes an authorization system 107. The server 106, client device 104, and / or the PAC device 101 can further include elements described with respect to FIG. 7 and FIG. 8, such as a processor and memory, having instructions stored thereon, that when executed by the processor, causes the processor to control the functions of the server / controller, client device 104, and / or the PAC device 101. The server 106 can be implemented on a centralized set of servers of a cloud-based system. In some cases, the embedded device 110 can store a filesystem that is used bythe client device 104, such as to perform operations for communicating with the PAC device 101 to gain access to a protected resource.
[0055] The server 106 searches a list of credentials stored in the authorization system 107 to determine whether the received credentials match credentials from the list of authorized credentials for accessing a secure asset or resource (e.g., door or secure area) protected by the PAC device 101. In response to determining that the received credentials are authorized to access the PAC device 101, the server 106 (also referred to as the controller) instructs the PAC device 101 to perform an operation granting access for the client device 104 (e.g., instructing the PAC device 101 to unlock a lock of a door).
[0056] FIG. 2 illustrates an allocated memory region, in accordance with some examples. Specifically, FIG. 2 illustrates an allocated memory region 204 showing the organization of memory blocks in a filesystem of the embedded device 110. The allocated memory region 204 demonstrates how memory is allocated from lower addresses towards higher addresses within a defined user memory space.
[0057] The allocated memory region 204 represents a dedicated portion of the embedded device 110 memory that is specifically organized for efficient memory block management. This allocated memory region 204 can be structured to allow multiple applications to access and utilize memory blocks while maintaining clear boundaries and status tracking. The allocated memory region 204 can be allocated by an operating system to an individual application or to multiple applications and starts at a defined beginning address where a memory block 206 is stored and extends to a specific end address corresponding to an end of an allocated memory region 212, creating a controlled space where memory blocks can be allocated, deleted, used, and reused.
[0058] Within this allocated memory region 204, memory is managed through a filesystem that organizes blocks sequentially from lower to higher addresses, with each block containing both a header 208 specifying its status and size, and a user data 210 portion. Different applications or a particular application with exclusive rights to the allocated memory region 204 can request and utilize memory blocks within this allocated memory region 204, with the system maintaining the integrity and boundaries of each block through the header information.
[0059] The allocated memory region 204 serves as a shared resource pool where applications can store and manage their data, but with the advantage of having built-in memory reuse capabilities that do not require complex allocation tables or extensive overhead. When an application no longer needs a memory block, it can be marked as deleted in the header, making it available for reuse by other applications while maintaining the overall structure and organization of the allocated region. This approach can be particularly beneficial for embedded devices with limited resources, as it provides a structured way for multiple applications to share and reuse memory space efficiently without the overhead of conventional memory management systems. The organization of the allocated memory region 204 ensures that even when different applications are accessing and modifying memory blocks, the system can maintain proper tracking and management through the header-based structure rather than complex pointer management systems.
[0060] At the beginning of the allocated memory region 204, the allocated memory region 204 can store the memory block 206. The memory block 206 represents an allocated and used memory block. This memory block 206 includes two components: a header 208 and user data 210, forming the basic structure that all memory blocks in the system follow.
[0061] The header 208 contains status information about the memory block 206, including whether it is free, used, or deleted (free and deleted are used interchangeably and are intended to mean the same thing), along with the length of user data contained within the block 206. This header-based approach eliminates the need for complex allocation tables typically required in conventional memory management systems. The user data 210 follows the header 208 and contains the actual data stored in the memory block 206. The size of this user data 210 is specified in the header 208, allowing the system to efficiently track and manage memory allocation without additional overhead.
[0062] The header 208 can contain a 1-byte OPTION field and a 4-byte SIZE field that work together to manage memory blocks efficiently. The OPTION field includes several components. The OPTION field includes a bit 8 that indicates whether the block is free (0) or used (1), bit 7 reserved for future use (RFU), and bits 1-6 that contain an integrity protection value calculated from the SIZE field. The integrity protection in bits 1-6 can be calculated by taking the mathematical sum of all four bytes in the SIZE field, adding bits 7 and 8 shifted to the lowest positions, and taking only the first 6 bits of this result.This integrity protection mechanism allows the system to verify that the size information stored in the SIZE field has not been corrupted or tampered with. When reading a block's header, the system can recalculate this protection value and compare it to the stored value in bits 1-6 to ensure the size information is valid. The SIZE field contains 4 bytes specifying the length of user data, though this can be reduced to 2 bytes for filesystems smaller than 64KB. This size information is used for determining where the next block begins, verifying available space when combining free blocks, and ensuring proper block alignment during garbage collection.
[0063] For example, consider a memory block with a SIZE field containing four bytes: 0x20 in byte 0 and 0x00 in bytes 1-3, representing a total size of 32 bytes. The OPTION field in this block's header has bit 8 set to 1 to indicate it is a used block, and bit 7 set to 0 for future use (RFU). To calculate the integrity protection value for bits 1-6, the system first adds all four bytes of the SIZE field together, resulting in 0x20 (since 0x20 + 0x00 + 0x00 + 0x00 = 0x20). The system then adds the values of bits 7 and 8 after shifting them to the lowest positions, such as bit 8 (1) becomes 0x01 and bit 7 (0) becomes 0x00. Adding these to the previous sum gives us 0x21 (0x20 + 0x01 + 0x00). The system takes only the first 6 bits of this result; 0x21 in binary is 00100001, so the first 6 bits (001000) give us 0x08, which is stored in bits 1-6 of the OPTION byte.
[0064] When the system later needs to verify the size field's integrity, the system reads the SIZE bytes and performs the same calculation. If the calculated value matches the protection value stored in bits 1-6 of the OPTION byte, the size information is valid. If they fail to match, this indicates the size field has been corrupted or tampered with. This integrity check is one example of integrity checking that can be used for proper block navigation and memory management, ensuring the system can reliably traverse the memory blocks using their size information. Other types of integrity checks can also be provided or used.
[0065] A pointer 214 can indicate the next free address in the allocated memory region 204 where new data can be allocated and stored in new memory blocks. This pointer 214 can be maintained to identify the next available space for memory allocation, always pointing to the location immediately following the last allocated memory block. The region following the pointer 214 up to the end of allocated memory region 212 represents a contiguous area of free memory blocks that have never been allocated or that are available for storing data (e.g., regions that were previously marked deleted orused and are now free). The pointer 214 can then be updated to reference a portion of the allocated memory region 204 that follows any moved blocks, with this portion having a starting address and ending at the region's end address, where each memory block in that portion is in either the free or deleted state.
[0066] The end of allocated memory region 212 marks the boundary of the allocated memory region 204, beyond which no memory allocations or storage of memory blocks can occur for a particular application and / or process or set of applications. When the pointer 214 reaches this boundary (e.g., the end of allocated memory region 212), the system implements the disclosed memory reuse strategy to find available space to store new user data.
[0067] The organization shown in FIG. 2 is particularly important for embedded devices with limited resources, as it provides a way to manage memory without the overhead of traditional filesystem approaches. This structure supports the system's ability to reuse deleted memory blocks when needed, while maintaining the integrity of the filesystem. The simplicity of this memory organization, with its header-based structure and sequential allocation approach, makes it suitable for resource-constrained embedded devices where conventional memory management techniques would be too resource-intensive.
[0068] FIG. 3 are diagrams of various states of memory blocks in the allocated memory region, in accordance with some examples. Specifically, FIG. 3 illustrates the process of memory block management and reuse through several stages, represented by first diagram 304, second diagram 306, and third diagram 322.
[0069] In the first diagram 304, the memory blocks (numbered 1-15) are shown in an initial state. The used memory block 308 (blocks represented by a first visual indicator, such as a numerical indicator) indicate used memory blocks. The first deleted memory block 310 and the second deleted memory block 312 (as well as other blocks represented by a second visual indicator, such as a letter indicator) represent deleted or free memory blocks.
[0070] The second diagram 306 shows the first phase of memory management. In the second diagram 306, adjacent deleted blocks have been combined to form larger free memory blocks (e.g., first combined free memory block 314). This combination process creates blocks labeled as A and B, which represent consolidated free space. Block A(corresponding to first combined free memory block 314) may have been formed by combining the first deleted memory block 310 and the second deleted memory block 312 which were identified as being deleted and adjacent to each other. Headers of the first deleted memory block 310 and the second deleted memory block 312 may be replaced with a new header for the first combined free memory block 314 indicating that the status of the first combined free memory block 314 is free and has a size corresponding to the combined sizes of the first deleted memory block 310 and second deleted memory block 312.
[0071] Similarly, Block B (corresponding to second combined free memory block 318) may have been formed by combining multiple adjacent deleted memory blocks (including the deleted memory blocks 316, such as blocks 9, 10, and 11) that were identified as being deleted and adjacent to each other during the parsing of the filesystem. The headers of these adjacent deleted blocks can be replaced with a new header for the second combined free memory block 318 indicating that the status of the second combined free memory block 318 is free and has a size corresponding to the combined sizes of the adjacent deleted memory blocks 9, 10, and 11. This combination process creates a larger contiguous free space that can be used for storing new memory blocks or accommodating moved blocks during garbage collection. The system maintains proper tracking of the combined block's size through the header information, allowing efficient reuse of the consolidated space.
[0072] In the third diagram 322, a new memory block 324, numbered 16, can be placed in one of the previously combined free spaces, such as a portion of the second combined free memory block 318. The arrow pointer shown in each diagram indicates the next free address where new memory can be allocated, always pointing to the location after the last allocated block. In the third diagram 322, when the new memory block 324 (numbered 16) is allocated within the second combined free memory block 318 (labeled as B), the size of block 16 is smaller than the total size of block B. This size difference results in a sub-block of combined free memory block 326 including unused portions of block B that remain after block 16 is allocated and stored in the second combined free memory block 318. The system maintains this sub-block of combined free memory block 326 as a separate free block by updating the header of block B to reflect its new reduced size, allowing it to be used for future memory allocations. This efficient use of space ensures that no usable memory is wasted, as the remaining portion can still accommodateadditional memory blocks that fit within its size. The header-based structure enables precise tracking of both the newly allocated block 16 and the sub-block of combined free memory block 326, maintaining proper memory organization and facilitating future allocations.
[0073] The progression from the first diagram 304, second diagram 306, and third diagram 322 shows the complete cycle of memory management: from initial block allocation through deletion, combination, and reuse. The system's ability to combine adjacent free blocks (shown in second diagram 306) helps prevent memory fragmentation and improves overall memory utilization.
[0074] The maintenance of proper headers throughout the process ensures that block status and size information remains accurate even after memory block combinations and reallocations.
[0075] The headers are used to determine the boundaries between the memory blocks to uniquely identify the storage regions of the allocated memory region 204 that contain each memory block. Specifically, the header of each memory block contains both status information and a size field that enables efficient traversal through the memory blocks. When the system needs to locate the next memory block, a processor reads the current block's header to determine its size, then adds that size value to the current block's starting address to calculate the starting address of the next block's header. For example, if a memory block starts at address X and its header indicates a size of N bytes, the system (also referred to as the processor) knows the next memory block's header begins at address X+N. This header-based navigation eliminates the need for complex pointer management structures or allocation tables. The header can be updated in several scenarios. When a block is deleted, the header status bit is changed to indicate the memory block is free / deleted. When adjacent free blocks are combined, the first block's header is updated with the total combined size. When a new block is allocated in a portion of a free block, the remaining free portion (also referred to as a sub-block) gets a new header with its reduced size.
[0076] The integrity of this addressing scheme is maintained through the header's protection field, which is calculated based on the mathematical sum of the size field bytes. This ensures the size information used for block navigation remains accurate and uncorrupted.
[0077] FIG. 4 are diagrams of various states of memory blocks in the allocated memory region, in accordance with some examples. The management of the memory blocks shown in FIG. 4 can be triggered in response to detecting that the pointer 214 has reached the end of allocated memory region 212. At this point, the processor can start searching for deleted blocks that can be combined into new combined blocks that are free to store data.
[0078] For example, the processor can identify or generate the first combined free memory block 410. This can be performed by the processor starting at the start of the address space of the allocated memory region 204. The processor can access the header for memory block 1 and determine that this block is used. The processor can use the header for memory block 1 to identify the start of the next block, such as memory block 2. The processor can access the header for memory block 2 and determine that this block is used. The processor can use the header for memory block 2 to identify the start of the next block, such as memory block A. The processor can determine that memory block A is free (e.g., by having previously combined deleted portions of one memory block with those of an adjacent memory block and updating the header to represent the memory block A). This memory block A can be the first combined free memory block 410.
[0079] In response to identifying the first combined free memory block 410, the processor can start searching for a used memory block. The processor accesses the header of the memory block 3 (e.g., first memory block 406) that sequentially follows the first combined free memory block 410. The processor can determine the size of the data of the first memory block 406. The processor can compare the size of the data of the first memory block 406 to the available space in the first combined free memory block 410. In response to determining that the size of the first memory block 406 is less than the available space in the first combined free memory block 410, the processor can move the user data from the first memory block 406 to the available space in the first combined free memory block 410. The processor can now generate a new header for the first combined used memory block 408 indicating the total used size of the first combined used memory block 408. The processor can generate a new header and store the new header after the end of the data stored in the first combined used memory block 408. The processor can store in the new header the status of the freed memory block 416 as free and the size. This size can correspond to the amount of unused portion of the firstcombined used memory block 408 and the size of the first memory block 406 that has been moved to the first combined used memory block 408.
[0080] This process is then repeated for the memory block 8 where the processor searches the allocated memory region 204 for a memory block having a size that fits into the size of the freed memory block 416. The processor can determine that memory block 8 has a size that fits into the freed memory block 416 to make up the used portion of freed memory block 414. In response, the processor can move the memory block 8 into the first combined used memory block 408. The processor can determine that the deleted memory block 418 is adjacent to the memory block 8 that has been moved. In such cases, the processor combines the deleted memory block 418 with the newly available space from the portion of memory block 8 that has been moved to form the memory block B (e.g., combined memory block from moved and deleted blocks 420).
[0081] The processor can determine that individual used memory block 424 has a size that fits the combined memory block from moved and deleted blocks 420. In such cases, the processor moves the individual used memory block 424 to the combined memory block from moved and deleted blocks 420 which creates a new block A with a larger available space, as shown in the diagram 426. The processor can then move block 5 into this new block A and can now shift the header of block A to the new location. Namely, in diagrams 426 and 428 of FIG. 4, block A's location changes as part of the memory block reorganization process. In diagram 426, block A appears after block 8 and before block 5. When block 5 is moved into block A in diagram 428, the header of block A is updated and shifted further down in the memory space, now appearing after block 5 and before block 6. This movement demonstrates how the system maintains proper block tracking through header updates while consolidating free space. The header of block A is updated to reflect both its new location and modified size after accommodating block 5. This process helps push the free blocks (like block A) toward the end of the allocated memory region while maintaining proper block alignment and data integrity through the header-based tracking system. The movement of block A between diagrams 426 and 428 shows how the system efficiently manages memory by relocating blocks to create larger contiguous free spaces, with each movement requiring appropriate header updates to maintain accurate status and size information. Further, diagrams diagram 428 and diagram 440 show the transition of block 6 moving to the start of block A and block A shifting down to take the place of block 6.
[0082] The diagrams 432, 434, 436, and 438 of FIG. 4, show the continued progression of memory block reorganization. In diagram 440, block A appears before block 7 and, when block 7 is moved into block A, the header of block A is updated and shifted further down in the memory space, now appearing after block 7 and before block 4 in the diagram 432. In the diagram 432 of FIG. 4, when block 4 is moved to block A, it creates a situation where the original location of block 4 becomes free space that is adjacent to block B. The system recognizes these adjacent free spaces and combines them to form a larger block A. This combination is achieved by updating the header of the first free block to reflect the total size of both previously separate free spaces.
[0083] The enlarged block A now has sufficient space to accommodate blocks 9 and 10. As shown in diagram 436 and diagram 438, this allows the system to move blocks 9 and 10 sequentially into the enlarged block A. With each move, the headers are updated to reflect both the new location of the moved blocks and the remaining free space in block A. This process effectively pushes block A toward the end of the allocated memory region as blocks 9 and 10 are relocated. The header-based tracking system maintains proper block alignment and data integrity throughout these movements, with each step requiring appropriate header updates to reflect the new block locations and sizes. By diagram 438, we see the completion of this sequence, with block A now positioned at the end of the allocated memory region, demonstrating the system's efficient approach to memory block consolidation and reuse.
[0084] Specifically, in diagrams 434 and 436, block 9 is identified as the next candidate for movement. The header of block A is again updated to reflect both its new location and modified size after accommodating block 9, pushing block A further toward the end of the allocated memory region. Moving to diagrams 436 and 438, block 10 is relocated into the available space in block A. The header updates maintain accurate tracking of block status and size information while consolidating free space. This movement continues to push block A toward the end of the memory region.
[0085] In diagram 438, the completion of this sequence of movements is shown, with block A now positioned at the end of the allocated memory region. Throughout this process, the system maintains proper block tracking through header updates while consolidating free space. Each movement requires updating the headers to reflect new locations and modified sizes, ensuring proper block alignment and data integrity through the header-based tracking system.
[0086] In some examples, when the embedded device 110 detects that the NEW pointer has reached the end of the memory space, the embedded device 110 begins searching for opportunities to reclaim space from deleted blocks. The embedded device 110 first examines the memory region starting from the lowest address, checking each block's header to identify deleted blocks that can be consolidated. For example, in diagram 404, blocks marked as deleted are combined to form larger free blocks, with their headers updated to reflect the combined sizes.
[0087] When a suitable free block is identified, like block A in diagram 404, the embedded device 110 examines the data size of nearby used blocks. If a used block's data can fit within the free space, as with block 3, the embedded device 110 transfers the data and updates both the source and destination headers accordingly.
[0088] This process continues with block 8, which is moved into another portion of the consolidated free space. The embedded device 110 carefully manages the headers during this move, ensuring the remaining free space is properly tracked with an updated header reflecting its new size.
[0089] The embedded device 110 then moves block 4 and identifies that block 4's original location becomes free space adjacent to block A. These adjacent free regions are automatically combined into a larger block A, with the header updated to reflect the total available space. Through additional moves illustrated in diagrams 428, 440, 432, 434, 436, and 438, this enlarged free region provides sufficient space for relocating blocks 9 and 10. The embedded device 110 moves these blocks sequentially, updating headers after each move to maintain accurate size and status information. This systematic approach gradually pushes the free space (block A) toward the higher memory addresses.
[0090] Throughout this process, the embedded device 110 maintains data integrity by carefully managing the block headers, which contain both status flags and size information. This header-based tracking eliminates the need for complex allocation tables while ensuring efficient space utilization. The process concludes when a desired amount of, or even all, possible block consolidations and movements have been completed, resulting in a more optimized memory layout with free space consolidated at the end of the region. This approach is particularly efficient for embedded devices with limited resources, as it minimizes overhead while maximizing memory reuse.
[0091] FIG. 5 illustrates a routine 500 (e.g., method or process) in accordance with some examples. The operations discussed in connection with FIG. 5 can be performed sequentially, in parallel, and in any suitable order. The operations discussed in FIG. 5 can be performed, for example, by the embedded device 110 of the access control system 103.
[0092] In operation 502, the embedded device 110 organizes a filesystem in a plurality of memory blocks within an allocated region of memory. Each memory block includes a header that specifies both the status of the block (free, used, or deleted) and the length of user data contained within that block. The status information in the header uses a 1-byte OPTION field where bit 8 indicates whether the block is free (0) or used (1), bit 7 is reserved for future use, and bits 1-6 contain an integrity protection value calculated from the SIZE field.
[0093] In operation 504, the embedded device 110 maintains a pointer to identify the next free memory block in the region. This pointer always points to the location immediately following the last allocated memory block where user data was last written and for which the status is in the used state. The pointer helps track where new memory can be allocated sequentially from lower to higher addresses.
[0094] When the pointer reaches the end of the allocated region, the embedded device 110 triggers operations 506 and 514. In operation 506, the system identifies a first set of memory blocks that have their status marked as deleted by parsing through the filesystem memory block headers from lower to higher addresses.
[0095] Finally, in operation 514, the embedded device 110 stores user data associated with a second set of memory blocks into the identified first set of deleted memory blocks. This process involves updating the headers of both the source and destination blocks to reflect their new status and contents while maintaining proper block alignment and data integrity through the header-based tracking system.
[0096] FIG. 6 illustrates a routine 606 for managing deleted memory blocks, in accordance with some examples. The routine 606 begins at operation 608 with "Start Memory Allocation" and follows a systematic decision tree for handling memory management.
[0097] At operation 610, the embedded device 110 checks if there is space at the end of memory. If space exists, new memory can be allocated directly at operation 638. If not, the process continues to operation 612.
[0098] At operation 612, the embedded device 110 determines if there are deleted blocks available. If no deleted blocks exist, the embedded device 110 cannot allocate more memory and performs operation 636. If deleted blocks are found, the embedded device 110 moves to operation 614.
[0099] In operation 614, the embedded device 110 parses the filesystem to combine adjacent free blocks. This consolidation process updates the headers of combined blocks to reflect their new total size. Operation 616 checks if a free block large enough for the allocation is found. If a suitable block is found, the embedded device 110 moves to operation 634 to allocate user data from new or existing memory blocks in the free block and update its header.
[0100] If no suitable free block is found at operation 616, the embedded device 110 performs operation 618 to initiate garbage collection. This leads to operation 620, which attempts to move a first used block after a free block. Operation 622 verifies if the block was moved successfully. If successful, at operation 624 the embedded device 110 updates the pointer to the moved block. If unsuccessful, the embedded device 110 moves to operation 626.
[0101] At operation 642, the embedded device 110 determines whether there are adjacent free blocks. If so, the embedded device 110 proceeds to operation 644 and, if not, the embedded device 110 proceeds to operation 628. At operation 644, the embedded device 110 determines whether it is possible to combine adjacent free blocks and updates their headers and then proceeds to operation 628.
[0102] At operation 626, the embedded device 110 determines whether to try moving the next used block. If yes, the embedded device 110 returns to operation 620. If no, the embedded device 110 proceeds to operation 630 where the embedded device 110 determines that it cannot allocate the memory block.
[0103] Operation 628 checks if there are more blocks to move. If yes, the embedded device 110 continues garbage collection at operation 620. If no, the embedded device 110 moves to operation 632. For example, the system parses through the memory blocks sequentially from lower to higher addresses, checking the header information of eachblock to identify used blocks that follow free blocks. When a block is moved, the embedded device 110 continues checking the next blocks to see if they also need to be moved. After moving a block, the embedded device 110 verifies if there are additional blocks that could fit into the remaining free space. The embedded device 110 does this by comparing the size field in the headers of subsequent blocks against available free space. If more blocks are found that could fit, garbage collection continues. The embedded device 110 checks for more blocks to move by identifying situations where moving a block would allow consolidation of adjacent free blocks. The embedded device 110 examines the headers of blocks following each move operation to determine if further consolidation and moves are possible.
[0104] Throughout this process, the system maintains proper block tracking through header updates, ensuring accurate status and size information for all memory blocks.
[0105] FIG. 7 is a block diagram illustrating an example of a software architecture 702 that may be installed on a machine, according to some examples. FIG. 7 is merely a nonlimiting example of a software architecture, and it will be appreciated that many other architectures may be implemented to facilitate the functionality described herein. The software architecture 702 may be executing on hardware such as a machine 800 of FIG.8 that includes, among other things, processors 802, memory 804, and input / output (I / O) components 842. A representative hardware layer 744 is illustrated and can represent, for example, the machine 800 of FIG. 8. The representative hardware layer 744 comprises one or more processing units 746 having associated executable instructions 748. The executable instructions 748 represent the executable instructions of the software architecture 702. The hardware layer 744 also includes memory 804, which also have the executable instructions 748. The hardware layer 744 may also comprise other hardware 752, which represents any other hardware of the hardware layer 744, such as the other hardware illustrated as part of the machine 800.
[0106] The instructions 748 may be transmitted or received over the network using a transmission medium via a network interface device (e.g., a network interface component included in the communication components 840) and utilizing any one of a number of well-known transfer protocols (e.g., hypertext transfer protocol (HTTP)). Similarly, the instructions 748 may be transmitted or received using a transmission medium via the coupling (e.g., a peer-to-peer coupling) to the devices. The terms “transmission medium” and “signal medium” mean the same thing and may be usedinterchangeably in this disclosure. The terms “transmission medium” and “signal medium” shall be taken to include any intangible medium that is capable of storing, encoding, or carrying the instructions 748 for execution by the machine 800, and include digital or analog communications signals or other intangible media to facilitate communication of such software. Hence, the terms “transmission medium” and “signal medium” shall be taken to include any form of modulated data signal, carrier wave, and so forth. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal.
[0107] The terms “machine-readable medium,” “computer-readable medium,” and “device-readable medium” mean the same thing and may be used interchangeably in this disclosure. The terms are defined to include both machine-storage media and transmission media. Thus, the terms include both storage devices / media and carrier waves / modulated data signals.
[0108] As used herein, the terms “machine-storage medium,” “device-storage medium,” and “computer-storage medium” mean the same thing and may be used interchangeably in this disclosure. The terms refer to a single or multiple storage devices and / or media (e.g., a centralized or distributed database, and / or associated caches and servers) that store executable instructions and / or data. The terms shall accordingly be taken to include, but not be limited to, solid-state memories, and optical and magnetic media, including memory internal or external to processors. Specific examples of machinestorage media, computer-storage media, and / or device-storage media include nonvolatile memory, including by way of example semiconductor memory devices, e.g., erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), field-programmable gate arrays (FPGAs), and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The terms “machinestorage medium,” “computer-storage medium,” and “device-storage medium” are non-transitory computer-readable media and specifically exclude carrier waves, modulated data signals, and other such media, at least some of which are covered under the term “signal medium.”
[0109] In the example architecture of FIG. 7, the software architecture 702 may be conceptualized as a stack of layers, where each layer provides particular functionality. For example, the software architecture 702 may include layers such as an operating system736, libraries 728, framework / middl eware 742, applications 716, and a presentation layer 714. Operationally, the applications 716 or other components within the layers may invoke API calls 724 through the software stack and receive a response, returned values, and so forth (illustrated as messages 726) in response to the API calls 724. The layers illustrated are representative in nature, and not all software architectures have all layers. For example, some mobile or special-purpose operating systems may not provide a framework / middleware 742 layer, while others may provide such a layer. Other software architectures may include additional or different layers.
[0110] The operating system 736 may manage hardware resources and provide common services. The operating system 736 may include, for example, a kernel 738, services 740, and drivers 742. The kernel 738 may act as an abstraction layer between the hardware and the other software layers. For example, the kernel 738 may be responsible for memory management, processor management (e.g., scheduling), component management, networking, security settings, and so on. The services 740 may provide other common services for the other software layers. The drivers 742 may be responsible for controlling or interfacing with the underlying hardware. For instance, the drivers 742 may include display drivers, camera drivers, Bluetooth® drivers, flash memory drivers, serial communication drivers (e.g., Universal Serial Bus (USB) drivers), Wi-Fi® drivers, audio drivers, power management drivers, and so forth depending on the hardware configuration.[OHl] The libraries 728 may provide a common infrastructure that may be utilized by the applications 716 and / or other components and / or layers. The libraries 728 typically provide functionality that allows other software modules to perform tasks in an easier fashion than by interfacing directly with the underlying operating system 736 functionality (e.g., kernel 738, services 740, or drivers 742). The libraries 728 may include system libraries 730 (e.g., C standard library) that may provide functions such as memory allocation functions, string manipulation functions, mathematic functions, and the like. In addition, the libraries 728 may include API libraries 732 such as media libraries (e.g., libraries to support presentation and manipulation of various media formats such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG), graphics libraries (e.g., an OpenGL framework that may be used to render 2D and 3D graphic content on a display), database libraries (e.g., SQLite that may provide various relational database functions), web libraries (e.g., WebKit that may provide web browsing functionality), and the like. Thelibraries 728 may also include a wide variety of other libraries 734 to provide many other APIs to the applications 716 and other software components / modules.
[0112] The frameworks / middleware 722 (also sometimes referred to as middleware) may provide a higher-level common infrastructure that may be utilized by the applications 716 or other software components / modules. For example, the frameworks / middleware 722 may provide various graphical user interface functions, high-level resource management, high-level location services, and so forth. The frameworks / middleware 722 may provide a broad spectrum of other APIs that may be utilized by the applications 716 and / or other software components / modules, some of which may be specific to a particular operating system or platform.
[0113] The applications 716 include built-in applications 718 and / or third-party applications 720. Examples of representative built-in applications 718 may include, but are not limited to, a home application, a contacts application, a browser application, a book reader application, a location application, a media application, a messaging application, or a game application.
[0114] The third-party applications 720 may include any of the built-in applications 718, as well as a broad assortment of other applications. In a specific example, the third-party applications 720 (e.g., an application developed using the Android™ or iOS™ software development kit (SDK) by an entity other than the vendor of the particular platform) may be mobile software running on a mobile operating system such as iOS™, Android™, or other mobile operating systems. In this example, the third-party applications 720 may invoke the API calls 724 provided by the mobile operating system such as the operating system 736 to facilitate functionality described herein.
[0115] The applications 716 may utilize built-in operating system functions (e.g., kernel 738, services 740, or drivers 742), libraries (e.g., system libraries 730, API libraries 732, and other libraries 734), or framework / middleware 742 to create user interfaces to interact with users of the system. Alternatively, or additionally, in some systems, interactions with a user may occur through a presentation layer, such as the presentation layer 714. In these systems, the application / module “logic” can be separated from the aspects of the application / module that interact with the user.
[0116] Some software architectures utilize virtual machines. In the example of FIG. 7, this is illustrated by a virtual machine 704. The virtual machine 704 creates a softwareenvironment where applications / modules can execute as if they were executing on a hardware machine (e.g., the machine 800 of FIG. 8). The virtual machine 704 is hosted by a host operating system (e.g., the operating system 736) and typically, although not always, has a virtual machine monitor, which manages the operation of the virtual machine 704 as well as the interface with the host operating system (e.g., the operating system 736). A software architecture executes within the virtual machine 704, such as an operating system 712, libraries 710, frameworks 708, applications 716, or a presentation layer 706. These layers of software architecture executing within the virtual machine 704 can be the same as corresponding layers previously described or may be different.
[0117] FIG. 8 is a diagrammatic representation of the machine 800 within which instructions 808 (e.g., software, a program, an application, an applet, an app, or other executable code) for causing the machine 800 to perform any one or more of the methodologies discussed herein may be executed. For example, the instructions 808 may cause the machine 800 to execute any one or more of the methods described herein. The instructions 808 transform the general, non-programmed machine 800 into a particular machine 800 programmed to carry out the described and illustrated functions in the manner described. The machine 800 may operate as a standalone device or may be coupled (e.g., networked) to other machines. In a networked deployment, the machine 800 may operate in the capacity of a server machine or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment. The machine 800 may comprise, but not be limited to, a server computer, a client computer, a personal computer (PC), a tablet computer, a laptop computer, a netbook, a set-top box (STB), a PDA, an entertainment media system, a cellular telephone, a smart phone, a mobile device, a wearable device (e.g., a smart watch), a smart home device (e.g., a smart appliance), other smart devices, a web appliance, a network router, a network switch, a network bridge, or any machine capable of executing the instructions 808, sequentially or otherwise, that specify actions to be taken by the machine 800. Further, while only a single machine 800 is illustrated, the term “machine” shall also be taken to include a collection of machines that individually or jointly execute the instructions 808 to perform any one or more of the methodologies discussed herein.
[0118] The machine 800 may include processors 802, memory 804, and I / O components 842, which may be configured to communicate with each other via a bus 844. In an example, the processors 802 (e.g., a Central Processing Unit (CPU), aReduced Instruction Set Computing (RISC) processor, a Complex Instruction Set Computing (CISC) processor, a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), an ASIC, a Radio-Frequency Integrated Circuit (RFIC), another processor, or any suitable combination thereof) may include, for example, a processor 806 and a processor 810 that execute the instructions 808. The term “processor” is intended to include multi-core processors that may comprise two or more independent processors (sometimes referred to as “cores”) that may execute instructions contemporaneously. Although FIG. 8 shows multiple processors 802, the machine 800 may include a single processor with a single core, a single processor with multiple cores (e.g., a multi-core processor), multiple processors with a single core, multiple processors with multiples cores, or any combination thereof.
[0119] The memory 804 includes a main memory 812, a static memory 814, and a storage unit 816, both accessible to the processors 802 via the bus 844. The main memory 804, the static memory 814, and storage unit 816 store the instructions 808 embodying any one or more of the methodologies or functions described herein. The instructions 808 may also reside, completely or partially, within the main memory 812, within the static memory 814, within machine-readable medium 818 within the storage unit 816, within at least one of the processors 802 (e.g., within the processor’s cache memory), or any suitable combination thereof, during execution thereof by the machine 800.
[0120] The I / O components 842 may include a wide variety of components to receive input, provide output, produce output, transmit information, exchange information, capture measurements, and so on. The specific I / O components 842 that are included in a particular machine will depend on the type of machine. For example, portable machines such as mobile phones may include a touch input device or other such input mechanisms, while a headless server machine will likely not include such a touch input device. It will be appreciated that the I / O components 842 may include many other components that are not shown in FIG. 8. In various examples, the I / O components 842 may include output components 828 and input components 830. The output components 828 may include visual components (e.g., a display such as a plasma display panel (PDP), a light emitting diode (LED) display, a liquid crystal display (LCD), a projector, or a cathode ray tube (CRT)), acoustic components (e.g., speakers), haptic components (e.g., a vibratory motor, resistance mechanisms), other signal generators, and so forth. Theinput components 830 may include alphanumeric input components (e.g., a keyboard, a touch screen configured to receive alphanumeric input, a photo-optical keyboard, or other alphanumeric input components), point-based input components (e.g., a mouse, a touchpad, a trackball, a joystick, a motion sensor, or another pointing instrument), tactile input components (e.g., a physical button, a touch screen that provides location and / or force of touches or touch gestures, or other tactile input components), audio input components (e.g., a microphone), and the like.
[0121] In further examples, the I / O components 842 may include biometric components 832, motion components 834, environmental components 836, or position components 838, among a wide array of other components. For example, the biometric components 832 include components to detect expressions (e.g., hand expressions, facial expressions, vocal expressions, body gestures, or eye tracking), measure biosignals (e.g., blood pressure, heart rate, body temperature, perspiration, or brain waves), identify a person (e.g., voice identification, retinal identification, facial identification, fingerprint identification, or electroencephalogram-based identification), and the like. The motion components 834 include acceleration sensor components (e.g., accelerometer), gravitation sensor components, rotation sensor components (e.g., gyroscope), and so forth. The environmental components 836 include, for example, illumination sensor components (e.g., photometer), temperature sensor components (e.g., one or more thermometers that detect ambient temperature), humidity sensor components, pressure sensor components (e.g., barometer), acoustic sensor components (e.g., one or more microphones that detect background noise), proximity sensor components (e.g., infrared sensors that detect nearby objects), gas sensors (e.g., gas detection sensors to detection concentrations of hazardous gases for safety or to measure pollutants in the atmosphere), or other components that may provide indications, measurements, or signals corresponding to a surrounding physical environment. The position components838 include location sensor components (e.g., a GPS receiver component), altitude sensor components (e.g., altimeters or barometers that detect air pressure from which altitude may be derived), orientation sensor components (e.g., magnetometers), and the like.
[0122] Communication may be implemented using a wide variety of technologies. The I / O components 842 further include communication components 840 operable to couple the machine 800 to a network 820 or devices 822 via a coupling 824 and a coupling 826,respectively. For example, the communication components 840 may include a network interface component or another suitable device to interface with the network 820. In further examples, the communication components 840 may include wired communication components, wireless communication components, cellular communication components, Near Field Communication (NFC) components, Bluetooth® components (e.g., Bluetooth® Low Energy), Wi-Fi® components, and other communication components to provide communication via other modalities. The devices 822 may be another machine or any of a wide variety of peripheral devices (e.g., a peripheral device coupled via a USB).
[0123] Moreover, the communication components 840 may detect identifiers or include components operable to detect identifiers. For example, the communication components 840 may include Radio Frequency Identification (RFID) tag reader components, NFC smart tag detection components, optical reader components (e.g., an optical sensor to detect one-dimensional bar codes such as Universal Product Code (UPC) bar code, multi-dimensional bar codes such as Quick Response (QR) code, Aztec code, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2D bar code, and other optical codes), or acoustic detection components (e.g., microphones to identify tagged audio signals). In addition, a variety of information may be derived via the communication components 840, such as location via Internet Protocol (IP) geolocation, location via Wi-Fi® signal triangulation, location via detecting an NFC beacon signal that may indicate a particular location, and so forth.
[0124] The various memories (e.g., memory 804, main memory 812, static memory 814, and / or memory of the processors 802) and / or storage unit 816 may store one or more sets of instructions and data structures (e.g., software) embodying or used by any one or more of the methodologies or functions described herein. These instructions (e.g., the instructions 808), when executed by processors 802, cause various operations to implement the disclosed examples.
[0125] The instructions 808 may be transmitted or received over the network 820, using a transmission medium, via a network interface device (e.g., a network interface component included in the communication components 840) and using any one of a number of well-known transfer protocols (e.g., hypertext transfer protocol (HTTP)). Similarly, the instructions 808 may be transmitted or received using a transmission medium via the coupling 826 (e.g., a peer-to-peer coupling) to the devices 822.
[0126] In view of the disclosure above, various examples are set forth below. It should be noted that one or more features of an example, taken in isolation or combination, should be considered within the disclosure of this application.
[0127] Example 1. A system comprising: one or more hardware processors; and at least one machine-storage medium for storing instructions that, when executed by the one or more hardware processors, cause the one or more hardware processors to perform operations comprising: organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each memory block of the plurality of memory blocks comprising a header specifying a status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state; maintaining a pointer to identify a next free memory block of the memory blocks in the allocated region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; and in response to determining that the pointer has reached an end of the allocated region of the memory: identifying a first set of memory blocks having the status in the deleted state; and storing user data, associated with a second set of memory blocks, in the first set of memory blocks.
[0128] Example 2. The system of Example 1, the operations comprising: moving user data previously stored in the second set of memory blocks having the status in the used state into the first set of memory blocks.
[0129] Example 3. The system of Example 2, the operations comprising: overwriting user data previously stored in the first set of memory blocks with at least a portion of the user data stored in the second set of memory blocks; and changing the status of the second set of memory blocks to the free state in response to moving the user data from the second set of memory blocks to the first set of memory blocks.
[0130] Example 4. The system of any one of Examples 1-3, the operations comprising: combining adjacent memory blocks having the status in the deleted state to form larger free memory blocks comprising the first set of memory blocks; and updating the header associated with the adjacent memory blocks to represent a size of the adjacent memory blocks.
[0131] Example 5. The system of Example 4, the operations comprising: accessing the header of a first memory block that sequentially follows the combined adjacent memory blocks; determining the length of the user data stored in the first memory block; comparing the length of the user data stored in the first memory block to the size of the adjacent memory blocks; determining whether the size of the adjacent memory blocks is greater than the length of the user data stored in the first memory block.
[0132] Example 6. The system of Example 5, the operations comprising: in response to determining that the size of the adjacent memory blocks is greater than the length of the user data stored in the first memory block, moving the user data from the first memory block to the adjacent memory blocks.
[0133] Example 7. The system of Example 6, the operations comprising: determining that the adjacent memory blocks comprise unused portions after moving the user data from the first memory block to the adjacent memory blocks; and in response to determining that the adjacent memory blocks comprise the unused portions after moving the user data from the first memory block to the adjacent memory blocks, storing a new header for a sub-block of the adjacent memory blocks representing a size of the unused portions in the sub-block.
[0134] Example 8. The system of any one of Examples 5-7, the operations comprising: in response to determining that the size of the adjacent memory blocks is less than the length of the user data stored in the first memory block, searching for a second memory block that sequentially follows the first memory block having a corresponding length of the user data stored in the header that is smaller than the size of the adjacent memory blocks.
[0135] Example 9. The system of any one of Examples 1-8, wherein the plurality of memory blocks have different sizes.
[0136] Example 10. The system of any one of Examples 1-9, wherein a size of each memory block of the plurality of memory blocks is static.
[0137] Example 11. The system of any one of Examples 1-10, wherein the operations for identifying the first set of memory blocks having the status in the deleted state comprise: parsing the headers of the plurality of memory blocks from lower addresses to higher addresses to identify a header in which the status comprises the deleted state.
[0138] Example 12. The system of any one of Examples 1-11, the operations comprising: updating the pointer to reference to a portion of the allocated region that follows the second set of memory blocks, the portion having a starting address and ending at an ending address of the region, and each memory block in the portion being in the free or deleted state.
[0139] Example 13. The system of any one of Examples 1-12, wherein the header comprises an integrity protection field calculated based on a mathematical sum of bytes in a size field of the header.
[0140] Example 14. The system of any one of Examples 1-13, wherein the header comprises a first portion and a second portion, the first portion comprising the status, and the second portion comprising the length of the user data.
[0141] Example 15. The system of Example 14, the operations comprising: using data stored in the first portion of the header to verify that the length of the user data stored in the second portion is correct.
[0142] Example 16. The system of any one of Examples 1-15, wherein moving the user data comprises: identifying a first used memory block located after a free memory block; determining whether the free memory block has sufficient size to store user data from the first used memory block; and in response to determining the free memory block has sufficient size, moving the user data from the first used memory block to the free memory block.
[0143] Example 17. A method comprising: organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each memory block of the plurality of memory blocks comprising a header specifying a status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state; maintaining a pointer to identify a next free memory block of the memory blocks in the allocated region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; and in response to determining that the pointer has reached an end of the allocated region of the memory: identifying a first set of memory blocks having the status in the deleted state; and moving user data stored in a second set of memory blocks having the status in the used state into the first set of memory blocks.
[0144] Example 18. A machine-storage medium for storing instructions that, when executed by one or more hardware processors, cause the one or more hardware processors to perform operations comprising: organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each memory block of the plurality of memory blocks comprising a header specifying a status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state; maintaining a pointer to identify a next free memory block of the memory blocks in the allocated region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; and in response to determining that the pointer has reached an end of the allocated region of the memory: identifying a first set of memory blocks having the status in the deleted state; and moving user data stored in a second set of memory blocks having the status in the used state into the first set of memory blocks.
[0145] Example 19. The machine-storage medium of Example 18, the operations comprising: moving user data previously stored in the second set of memory blocks having the status in the used state into the first set of memory blocks.
[0146] Example 20. The machine-storage medium of Example 19, the operations comprising: overwriting user data previously stored in the first set of memory blocks with at least a portion of the user data stored in the second set of memory blocks; and changing the status of the second set of memory blocks to the free state in response to moving the user data from the second set of memory blocks to the first set of memory blocks.
[0147] Although examples have been described, it will be evident that various modifications and changes may be made to these examples without departing from the broader scope of the present disclosure. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense. The accompanying drawings that form a part hereof, show by way of illustration, and not of limitation, specific examples in which the subject matter may be practiced. The examples illustrated are described in sufficient detail to enable those skilled in the art to practice the teachings disclosed herein. Other examples may be utilized and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of this disclosure. This Detailed Description, therefore, is not to be taken in alimiting sense, and the scope of various examples is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.
[0148] Such examples of the inventive subject matter may be referred to herein, individually and / or collectively, by the term "invention" merely for convenience and without intending to voluntarily limit the scope of this application to any single invention or inventive concept if more than one is in fact disclosed. Thus, although specific examples have been illustrated and described herein, it should be appreciated that any arrangement calculated to achieve the same purpose may be substituted for the specific examples shown. This disclosure is intended to cover any and all adaptations or variations of various examples. Combinations of the above examples, and other examples not specifically described herein, will be apparent to those of skill in the art upon reviewing the above description.
[0149] The Abstract of the Disclosure is provided to allow the reader to quickly ascertain the nature of the technical disclosure. It is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims. In addition, in the foregoing Detailed Description, it can be seen that various features are grouped together in a single example for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed examples require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive subject matter lies in less than all features of a single disclosed example. Thus the following claims are hereby incorporated into the Detailed Description, with each claim standing on its own as a separate example.
Claims
What is claimed is:
1. A system comprising:one or more hardware processors; andat least one machine-storage medium for storing instructions that, when executed by the one or more hardware processors, cause the one or more hardware processors to perform operations comprising:organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each memory block of the plurality of memory blocks comprising a header specifying status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state;maintaining a pointer to identify a next free memory block of the memory blocks in the allocated region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; andin response to determining that the pointer has reached an end of the allocated region of the memory:identifying a first set of memory blocks having the status in the deleted state; andstoring user data, associated with a second set of memory blocks, in the first set of memory blocks.
2. The system of claim 1, the operations comprising:moving user data previously stored in the second set of memory blocks having the status in the used state into the first set of memory blocks.
3. The system of claim 2, the operations comprising:overwriting user data previously stored in the first set of memory blocks with at least a portion of the user data stored in the second set of memory blocks; and changing the status of the second set of memory blocks to the free state in response to moving the user data from the second set of memory blocks to the first set of memory blocks.
4. The system of claim 1, the operations comprising:combining adjacent memory blocks having the status in the deleted state to form larger free memory blocks comprising the first set of memory blocks; andupdating the header associated with the adjacent memory blocks to represent a size of the adjacent memory blocks.
5. The system of claim 4, the operations comprising:accessing the header of a first memory block that sequentially follows the combined adjacent memory blocks;determining the length of the user data stored in the first memory block; comparing the length of the user data stored in the first memory block to the size of the adjacent memory blocks;determining whether the size of the adjacent memory blocks is greater than the length of the user data stored in the first memory block.
6. The system of claim 5, the operations comprising:in response to determining that the size of the adjacent memory blocks is greater than the length of the user data stored in the first memory block, moving the user data from the first memory block to the adjacent memory blocks.
7. The system of claim 6, the operations comprising:determining that the adjacent memory blocks comprise unused portions after moving the user data from the first memory block to the adjacent memory blocks; and in response to determining that the adjacent memory blocks comprise the unused portions after moving the user data from the first memory block to the adjacent memory blocks, storing a new header for a sub-block of the adjacent memory blocks representing a size of the unused portions in the sub-block.
8. The system of claim 5, the operations comprising:in response to determining that the size of the adjacent memory blocks is less than the length of the user data stored in the first memory block, searching for a second memory block that sequentially follows the first memory block having a corresponding length of the user data stored in the header that is smaller than the size of the adjacent memory blocks.
9. The system of claim 1, wherein the plurality of memory blocks have different sizes.
10. The system of claim 1, wherein a size of each memory block of the plurality of memory blocks is static.
11. The system of claim 1, wherein the operations for identifying the first set of memory blocks having the status in the deleted state comprise:parsing the headers of the plurality of memory blocks from lower addresses to higher addresses to identify a header in which the status comprises the deleted state.
12. The system of claim 1, the operations comprising:updating the pointer to reference to a portion of the allocated region that follows the second set of memory blocks, the portion having a starting address and ending at an ending address of the allocated region, and each memory block in the portion being in the free or deleted state.
13. The system of claim 1, wherein the header comprises an integrity protection field calculated based on a mathematical sum of bytes in a size field of the header.
14. The system of claim 1, wherein the header comprises a first portion and a second portion, the first portion comprising the status, and the second portion comprising the length of the user data.
15. The system of claim 14, the operations comprising:using data stored in the first portion of the header to verify that the length of the user data stored in the second portion is correct.
16. The system of claim 1, wherein moving the user data comprises:identifying a first used memory block located after a free memory block; determining whether the free memory block has sufficient size to store user data from the first used memory block; andin response to determining the free memory block has sufficient size, moving the user data from the first used memory block to the free memory block.
17. A method comprising:organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each memory block of the plurality of memory blocks comprising a header specifying a status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state;maintaining a pointer to identify a next free memory block of the memory blocks in the allocated region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; andin response to determining that the pointer has reached an end of the allocated region of the memory:identifying a first set of memory blocks having the status in the deleted state; and moving user data stored in a second set of memory blocks having the status in the used state into the first set of memory blocks.
18. A machine-storage medium for storing instructions that, when executed by one or more hardware processors, cause the one or more hardware processors to perform operations comprising:organizing a filesystem in a plurality of memory blocks of an allocated region of memory, each memory block of the plurality of memory blocks comprising a header specifying a status of the memory block and a length of user data inside the memory block, the status comprising one of a free state, a used state, or a deleted state;maintaining a pointer to identify a next free memory block of the memory blocks in the allocated region for which the status is in the free state, the next free memory block sequentially following a last allocated memory block in which user data for the filesystem was last written and for which the status is in the used state; andin response to determining that the pointer has reached an end of the allocated region of the memory:identifying a first set of memory blocks having the status in the deleted state; and moving user data stored in a second set of memory blocks having the status in the used state into the first set of memory blocks.
19. The machine-storage medium of claim 18, the operations comprising:moving user data previously stored in the second set of memory blocks having the status in the used state into the first set of memory blocks.
20. The machine-storage medium of claim 19, the operations comprising:overwriting user data previously stored in the first set of memory blocks with at least a portion of the user data stored in the second set of memory blocks; and changing the status of the second set of memory blocks to the free state in response to moving the user data from the second set of memory blocks to the first set of memory blocks.